Class: JSTestSan::Runner
- Inherits:
-
OSX::NSObject
- Object
- OSX::NSObject
- JSTestSan::Runner
- Defined in:
- lib/js_test_san/runner.rb
Instance Attribute Summary collapse
-
#did_not_pass ⇒ Object
readonly
Returns the value of attribute did_not_pass.
-
#queued ⇒ Object
readonly
Returns the value of attribute queued.
-
#test_cases ⇒ Object
readonly
Returns the value of attribute test_cases.
Instance Method Summary collapse
- #assertions ⇒ Object
- #errors ⇒ Object
- #failures ⇒ Object
- #finished? ⇒ Boolean
- #initWithHTMLFiles(html_files) ⇒ Object
- #run ⇒ Object
- #test_case_finished(test_case) ⇒ Object
- #test_ran(test) ⇒ Object
- #tests ⇒ Object
Instance Attribute Details
#did_not_pass ⇒ Object (readonly)
Returns the value of attribute did_not_pass.
5 6 7 |
# File 'lib/js_test_san/runner.rb', line 5 def did_not_pass @did_not_pass end |
#queued ⇒ Object (readonly)
Returns the value of attribute queued.
5 6 7 |
# File 'lib/js_test_san/runner.rb', line 5 def queued @queued end |
#test_cases ⇒ Object (readonly)
Returns the value of attribute test_cases.
5 6 7 |
# File 'lib/js_test_san/runner.rb', line 5 def test_cases @test_cases end |
Instance Method Details
#assertions ⇒ Object
27 |
# File 'lib/js_test_san/runner.rb', line 27 def assertions; sum :assertions end |
#errors ⇒ Object
29 |
# File 'lib/js_test_san/runner.rb', line 29 def errors; sum :errors end |
#failures ⇒ Object
28 |
# File 'lib/js_test_san/runner.rb', line 28 def failures; sum :failures end |
#finished? ⇒ Boolean
49 50 51 |
# File 'lib/js_test_san/runner.rb', line 49 def finished? @finished end |
#initWithHTMLFiles(html_files) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/js_test_san/runner.rb', line 7 def initWithHTMLFiles(html_files) if init @test_cases = [] @test_cases = html_files.map { |file| TestCase.alloc.initWithHTMLFile_delegate(file, self) } @queued = @test_cases.dup @did_not_pass = [] $stdout.sync = true self end end |
#run ⇒ Object
20 21 22 23 24 |
# File 'lib/js_test_san/runner.rb', line 20 def run @start_time = Time.now @queued.first.run OSX::NSApplication.sharedApplication.run end |
#test_case_finished(test_case) ⇒ Object
44 45 46 47 |
# File 'lib/js_test_san/runner.rb', line 44 def test_case_finished(test_case) @queued.delete(test_case) @queued.empty? ? finalize : @queued.first.run end |
#test_ran(test) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/js_test_san/runner.rb', line 31 def test_ran(test) @did_not_pass << test unless test.state == :passed print case test.state when :passed '.' when :failed 'F' when :error 'E' end end |
#tests ⇒ Object
26 |
# File 'lib/js_test_san/runner.rb', line 26 def tests; sum :tests end |