Class: TestFileRunner
- Inherits:
-
Object
- Object
- TestFileRunner
- Defined in:
- lib/sfb_scripts/test_running/test_file_runner.rb
Instance Attribute Summary collapse
-
#ignore_selenium ⇒ Object
readonly
Returns the value of attribute ignore_selenium.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
-
#test_runner ⇒ Object
readonly
Returns the value of attribute test_runner.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
Class Method Summary collapse
Instance Method Summary collapse
- #find(inputs) ⇒ Object
-
#initialize(env, ignore_selenium) ⇒ TestFileRunner
constructor
A new instance of TestFileRunner.
- #status ⇒ Object
Constructor Details
#initialize(env, ignore_selenium) ⇒ TestFileRunner
Returns a new instance of TestFileRunner.
12 13 14 15 16 17 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 12 def initialize(env, ignore_selenium) @repo = env[:repo] @shell = env[:shell] @test_runner = env[:test_runner] @ignore_selenium = ignore_selenium end |
Instance Attribute Details
#ignore_selenium ⇒ Object (readonly)
Returns the value of attribute ignore_selenium.
11 12 13 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 11 def ignore_selenium @ignore_selenium end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
11 12 13 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 11 def repo @repo end |
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
11 12 13 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 11 def shell @shell end |
#test_runner ⇒ Object (readonly)
Returns the value of attribute test_runner.
11 12 13 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 11 def test_runner @test_runner end |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
11 12 13 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 11 def tests @tests end |
Class Method Details
.find(inputs, env) ⇒ Object
3 4 5 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 3 def self.find(inputs, env) new(env, false).find(inputs) end |
.status(env, ignore_selenium = false) ⇒ Object
7 8 9 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 7 def self.status(env, ignore_selenium=false) new(env, ignore_selenium).status end |
Instance Method Details
#find(inputs) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 19 def find(inputs) files = [] inputs.each {|input| files << repo.find_files(input).map {|f| {:file => f} } } files.flatten! @tests = TestCollection.new(files) return false unless @tests.present? test_runner.run_files(tests) end |
#status ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sfb_scripts/test_running/test_file_runner.rb', line 29 def status files = repo.status_files.map {|f| {:file => f} } @tests = TestCollection.new(files) if tests.include_selenium? handle_selenium end if tests.empty? shell.notify 'No tests to run' exit end test_runner.run_files(tests) end |