Class: Guard::Minitest::Inspector
- Inherits:
-
Object
- Object
- Guard::Minitest::Inspector
- Defined in:
- lib/guard/minitest/inspector.rb
Instance Attribute Summary collapse
-
#test_file_patterns ⇒ Object
readonly
Returns the value of attribute test_file_patterns.
-
#test_folders ⇒ Object
readonly
Returns the value of attribute test_folders.
Instance Method Summary collapse
- #all_test_files ⇒ Object
- #clean(paths) ⇒ Object
- #clean_all ⇒ Object
- #clear_memoized_test_files ⇒ Object
-
#initialize(test_folders, test_file_patterns) ⇒ Inspector
constructor
A new instance of Inspector.
Constructor Details
#initialize(test_folders, test_file_patterns) ⇒ Inspector
Returns a new instance of Inspector.
8 9 10 11 |
# File 'lib/guard/minitest/inspector.rb', line 8 def initialize(test_folders, test_file_patterns) @test_folders = test_folders.uniq.compact @test_file_patterns = test_file_patterns.uniq.compact end |
Instance Attribute Details
#test_file_patterns ⇒ Object (readonly)
Returns the value of attribute test_file_patterns.
6 7 8 |
# File 'lib/guard/minitest/inspector.rb', line 6 def test_file_patterns @test_file_patterns end |
#test_folders ⇒ Object (readonly)
Returns the value of attribute test_folders.
6 7 8 |
# File 'lib/guard/minitest/inspector.rb', line 6 def test_folders @test_folders end |
Instance Method Details
#all_test_files ⇒ Object
32 33 34 |
# File 'lib/guard/minitest/inspector.rb', line 32 def all_test_files @all_test_files ||= _test_files_for_paths end |
#clean(paths) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/guard/minitest/inspector.rb', line 17 def clean(paths) paths.reduce([]) do |memo, path| if File.directory?(path) memo += _test_files_for_paths(path) else memo << path if _test_file?(path) end memo end.uniq end |
#clean_all ⇒ Object
13 14 15 |
# File 'lib/guard/minitest/inspector.rb', line 13 def clean_all clean(test_folders) end |
#clear_memoized_test_files ⇒ Object
28 29 30 |
# File 'lib/guard/minitest/inspector.rb', line 28 def clear_memoized_test_files @all_test_files = nil end |