Class: TestFinder
- Inherits:
-
Object
- Object
- TestFinder
- Defined in:
- lib/sfb_scripts/test_running/test_finder.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
Returns the value of attribute query.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#shell ⇒ Object
Returns the value of attribute shell.
Class Method Summary collapse
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(env, query) ⇒ TestFinder
constructor
A new instance of TestFinder.
Constructor Details
#initialize(env, query) ⇒ TestFinder
Returns a new instance of TestFinder.
8 9 10 11 12 13 |
# File 'lib/sfb_scripts/test_running/test_finder.rb', line 8 def initialize(env, query) @shell = env[:shell] @repo = env[:repo] @query = query @regex_searches = {} end |
Instance Attribute Details
#query ⇒ Object
Returns the value of attribute query.
7 8 9 |
# File 'lib/sfb_scripts/test_running/test_finder.rb', line 7 def query @query end |
#repo ⇒ Object
Returns the value of attribute repo.
7 8 9 |
# File 'lib/sfb_scripts/test_running/test_finder.rb', line 7 def repo @repo end |
#shell ⇒ Object
Returns the value of attribute shell.
7 8 9 |
# File 'lib/sfb_scripts/test_running/test_finder.rb', line 7 def shell @shell end |
Class Method Details
.find(query, env) ⇒ Object
3 4 5 |
# File 'lib/sfb_scripts/test_running/test_finder.rb', line 3 def self.find(query, env) new(env, query).find end |
Instance Method Details
#find ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sfb_scripts/test_running/test_finder.rb', line 15 def find return tests_found_by_absolute_path if query.match(Repo.root_dir) return tests_found_by_name if tests_found_by_name.present? return tests_found_by_file_name if tests_found_by_file_name.present? return tests_found_by_full_regex if tests_found_by_full_regex.present? return TestCollection.new end |