Class: TestFindFiles

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/find_files.rb

Instance Method Summary collapse

Instance Method Details

#test_find_files_in_multiple_pathsObject



78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/find_files.rb', line 78

def test_find_files_in_multiple_paths
  # Test with multiple paths
  expected_files = [
    'lib/markdown_exec/version.rb',
    'spec/cli_spec.rb',
    'spec/env_spec.rb',
    'spec/markdown_exec_spec.rb',
    'spec/tap_spec.rb'
  ]
  result = find_files('*', ['lib/**', 'spec'])
  expected_files.each do |file|
    assert_includes result, file
  end
end

#test_find_files_no_recursionObject



57
58
59
60
61
# File 'lib/find_files.rb', line 57

def test_find_files_no_recursion
  # Test with no recursive directories
  result = find_files('cli.rb', ['lib'])
  assert_includes result, 'lib/cli.rb'
end

#test_find_files_with_hidden_filesObject



93
94
95
96
97
# File 'lib/find_files.rb', line 93

def test_find_files_with_hidden_files
  # Test to ensure hidden files are also found
  result = find_files('.gitignore', ['.'])
  assert_includes result, './.gitignore'
end

#test_find_files_with_recursionObject



63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/find_files.rb', line 63

def test_find_files_with_recursion
  # Test with recursive directories
  expected_files = [
    'lib/cli.rb',
    'lib/colorize.rb',
    'lib/dev/watchfile.sh',
    'lib/markdown_exec.rb',
    'lib/markdown_exec/version.rb'
  ]
  result = find_files('*', ['lib/**'])
  expected_files.each do |file|
    assert_includes result, file
  end
end