Class: DirectorySearcherTest2

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

Overview

Test class for DirectorySearcher

Instance Method Summary collapse

Instance Method Details

#setupObject

Setup method to initialize common test data



244
245
246
247
248
249
250
# File 'lib/directory_searcher.rb', line 244

def setup
  @pattern_spec = /spec/
  @paths = ['./spec']
  @filename_glob = nil
  @searcher_spec = DirectorySearcher.new(@pattern_spec, @paths,
                                         filename_glob: @filename_glob)
end

#test_search_in_directory_names_for_specObject

Test search_in_directory_names method for ‘spec’



253
254
255
256
257
# File 'lib/directory_searcher.rb', line 253

def test_search_in_directory_names_for_spec
  # Replace with actual expected directory names containing 'spec'
  expected_dirs = ['./spec']
  assert_equal expected_dirs, @searcher_spec.search_in_directory_names
end

#test_search_in_file_names_for_specObject

Test search_in_file_names method for ‘spec’



260
261
262
263
264
265
# File 'lib/directory_searcher.rb', line 260

def test_search_in_file_names_for_spec
  # Replace with actual expected file names containing 'spec'
  expected_files = ['./spec/cli_spec.rb', './spec/env_spec.rb',
                    './spec/markdown_exec_spec.rb', './spec/tap_spec.rb']
  assert_equal expected_files, @searcher_spec.search_in_file_names
end