Class: PryTest::Runner
- Inherits:
-
Object
- Object
- PryTest::Runner
- Defined in:
- lib/pry-test/runner.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#failed ⇒ Object
readonly
Returns the value of attribute failed.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#passed ⇒ Object
readonly
Returns the value of attribute passed.
Class Method Summary collapse
Instance Method Summary collapse
- #failed_tests ⇒ Object
-
#initialize(formatter, options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #passed_tests ⇒ Object
- #run ⇒ Object
- #test_classes ⇒ Object
- #tests ⇒ Object
Constructor Details
#initialize(formatter, options = {}) ⇒ Runner
18 19 20 21 |
# File 'lib/pry-test/runner.rb', line 18 def initialize(formatter, ={}) @formatter = formatter = end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
16 17 18 |
# File 'lib/pry-test/runner.rb', line 16 def duration @duration end |
#failed ⇒ Object (readonly)
Returns the value of attribute failed.
16 17 18 |
# File 'lib/pry-test/runner.rb', line 16 def failed @failed end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
16 17 18 |
# File 'lib/pry-test/runner.rb', line 16 def formatter @formatter end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
16 17 18 |
# File 'lib/pry-test/runner.rb', line 16 def end |
#passed ⇒ Object (readonly)
Returns the value of attribute passed.
16 17 18 |
# File 'lib/pry-test/runner.rb', line 16 def passed @passed end |
Class Method Details
.terminate ⇒ Object
7 8 9 |
# File 'lib/pry-test/runner.rb', line 7 def terminate @terminate = true end |
.terminate? ⇒ Boolean
11 12 13 |
# File 'lib/pry-test/runner.rb', line 11 def terminate? !!@terminate end |
Instance Method Details
#failed_tests ⇒ Object
38 39 40 |
# File 'lib/pry-test/runner.rb', line 38 def failed_tests tests.select{ |test| test.invoked? && !test.passed? } end |
#passed_tests ⇒ Object
46 47 48 |
# File 'lib/pry-test/runner.rb', line 46 def passed_tests tests.select{ |test| test.invoked? && test.passed? } end |
#run ⇒ Object
23 24 25 26 27 28 |
# File 'lib/pry-test/runner.rb', line 23 def run formatter.before_suite(test_classes) run_test_classes formatter.after_suite(test_classes) failed end |
#test_classes ⇒ Object
30 31 32 |
# File 'lib/pry-test/runner.rb', line 30 def test_classes @test_classes ||= PryTest::Test.subclasses.shuffle end |
#tests ⇒ Object
34 35 36 |
# File 'lib/pry-test/runner.rb', line 34 def tests @tests ||= test_classes.map{ |klass| klass.tests }.flatten end |