Class: DirectorySearcherTest2
- Defined in:
- lib/directory_searcher.rb
Overview
Test class for DirectorySearcher
Instance Method Summary collapse
-
#setup ⇒ Object
Setup method to initialize common test data.
-
#test_find_directory_names_for_spec ⇒ Object
Test find_directory_names method for ‘spec’.
-
#test_find_file_names_for_spec ⇒ Object
Test find_file_names method for ‘spec’.
Instance Method Details
#setup ⇒ Object
Setup method to initialize common test data
246 247 248 249 250 251 252 |
# File 'lib/directory_searcher.rb', line 246 def setup @pattern_spec = /spec/ @paths = ['./spec'] @filename_glob = nil @searcher_spec = DirectorySearcher.new(@pattern_spec, @paths, filename_glob: @filename_glob) end |
#test_find_directory_names_for_spec ⇒ Object
Test find_directory_names method for ‘spec’
255 256 257 258 259 |
# File 'lib/directory_searcher.rb', line 255 def test_find_directory_names_for_spec # Replace with actual expected directory names containing 'spec' expected_dirs = ['./spec'] assert_equal expected_dirs, @searcher_spec.find_directory_names end |
#test_find_file_names_for_spec ⇒ Object
Test find_file_names method for ‘spec’
262 263 264 265 266 267 |
# File 'lib/directory_searcher.rb', line 262 def test_find_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.find_file_names end |