Class: PrettyTest::Runner
- Inherits:
-
MiniTest::Unit
- Object
- MiniTest::Unit
- PrettyTest::Runner
- Defined in:
- lib/pretty_test/runner.rb
Defined Under Namespace
Classes: TestRecord
Constant Summary collapse
- SKIP_FORMAT =
"\e[33m[SKIPPED] %s: %s\e[0m\n%s\n%s"- FAILURE_FORMAT =
"\e[31m[FAILURE] %s: %s\e[0m\n\e[31m%s: %s\e[0m\n%s"- ERROR_FORMAT =
"\e[31m[ERROR] %s: %s\e[0m\n\e[31m%s: %s\e[0m\n%s"- STATUS_FORMAT =
"\e[2K\r\e[?7l\e[37m(%.1fs) \e[32m%d/%d tests (%d%%)\e[37m, \e[36m%d assertions\e[37m, \e[31m%d errors\e[37m, \e[31m%d failures\e[37m, \e[33m%d skips \e[37m%s\e[?7h\e[0m"
Instance Attribute Summary collapse
-
#assertion_count ⇒ Object
Returns the value of attribute assertion_count.
-
#completed ⇒ Object
Returns the value of attribute completed.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#suite_name ⇒ Object
Returns the value of attribute suite_name.
-
#test_count ⇒ Object
Returns the value of attribute test_count.
-
#test_name ⇒ Object
Returns the value of attribute test_name.
-
#test_record ⇒ Object
Returns the value of attribute test_record.
Instance Method Summary collapse
- #_run_anything(type) ⇒ Object
- #_run_suite(suite, type) ⇒ Object
- #_run_suites(suites, type) ⇒ Object
- #record(suite, test, assertions, time, exception) ⇒ Object
Instance Attribute Details
#assertion_count ⇒ Object
Returns the value of attribute assertion_count.
12 13 14 |
# File 'lib/pretty_test/runner.rb', line 12 def assertion_count @assertion_count end |
#completed ⇒ Object
Returns the value of attribute completed.
12 13 14 |
# File 'lib/pretty_test/runner.rb', line 12 def completed @completed end |
#started_at ⇒ Object
Returns the value of attribute started_at.
12 13 14 |
# File 'lib/pretty_test/runner.rb', line 12 def started_at @started_at end |
#suite_name ⇒ Object
Returns the value of attribute suite_name.
12 13 14 |
# File 'lib/pretty_test/runner.rb', line 12 def suite_name @suite_name end |
#test_count ⇒ Object
Returns the value of attribute test_count.
12 13 14 |
# File 'lib/pretty_test/runner.rb', line 12 def test_count @test_count end |
#test_name ⇒ Object
Returns the value of attribute test_name.
12 13 14 |
# File 'lib/pretty_test/runner.rb', line 12 def test_name @test_name end |
#test_record ⇒ Object
Returns the value of attribute test_record.
12 13 14 |
# File 'lib/pretty_test/runner.rb', line 12 def test_record @test_record end |
Instance Method Details
#_run_anything(type) ⇒ Object
14 15 16 17 |
# File 'lib/pretty_test/runner.rb', line 14 def _run_anything(type) suites = TestCase.send("#{type}_suites") _run_suites(suites, type) end |
#_run_suite(suite, type) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/pretty_test/runner.rb', line 26 def _run_suite(suite, type) before_suite(suite) tests = suite.send("#{type}_methods") tests.each do |test| run_test(suite, test) end ensure after_suite(suite, type) end |
#_run_suites(suites, type) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/pretty_test/runner.rb', line 19 def _run_suites(suites, type) before_suites(suites, type) super ensure after_suites(suites, type) end |
#record(suite, test, assertions, time, exception) ⇒ Object
36 37 38 |
# File 'lib/pretty_test/runner.rb', line 36 def record(suite, test, assertions, time, exception) @test_record = TestRecord.new(suite, test, assertions, time, exception) end |