Class: SelfTestingFramework::TestResult
- Inherits:
-
Object
- Object
- SelfTestingFramework::TestResult
- Defined in:
- lib/self_testing_framework/test_result.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#errors_count ⇒ Object
readonly
Returns the value of attribute errors_count.
-
#passed_count ⇒ Object
readonly
Returns the value of attribute passed_count.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
-
#total_count ⇒ Object
readonly
Returns the value of attribute total_count.
Instance Method Summary collapse
- #errored(klass_name, test_name, error) ⇒ Object
-
#initialize ⇒ TestResult
constructor
A new instance of TestResult.
- #last_test ⇒ Object
- #passed(klass_name, test_name) ⇒ Object
Constructor Details
#initialize ⇒ TestResult
Returns a new instance of TestResult.
6 7 8 9 10 11 12 |
# File 'lib/self_testing_framework/test_result.rb', line 6 def initialize @errors_count = 0 @passed_count = 0 @errors = [] @tests = [] @total_count = 0 end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/self_testing_framework/test_result.rb', line 4 def errors @errors end |
#errors_count ⇒ Object (readonly)
Returns the value of attribute errors_count.
4 5 6 |
# File 'lib/self_testing_framework/test_result.rb', line 4 def errors_count @errors_count end |
#passed_count ⇒ Object (readonly)
Returns the value of attribute passed_count.
4 5 6 |
# File 'lib/self_testing_framework/test_result.rb', line 4 def passed_count @passed_count end |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
4 5 6 |
# File 'lib/self_testing_framework/test_result.rb', line 4 def tests @tests end |
#total_count ⇒ Object (readonly)
Returns the value of attribute total_count.
4 5 6 |
# File 'lib/self_testing_framework/test_result.rb', line 4 def total_count @total_count end |
Instance Method Details
#errored(klass_name, test_name, error) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/self_testing_framework/test_result.rb', line 20 def errored(klass_name, test_name, error) @errors_count += 1 @tests << {:class_name => klass_name, :test_name => test_name, :error => error} @errors << {:class_name => klass_name, :test_name => test_name, :error => error} @total_count += 1 end |
#last_test ⇒ Object
27 28 29 |
# File 'lib/self_testing_framework/test_result.rb', line 27 def last_test @tests.last end |
#passed(klass_name, test_name) ⇒ Object
14 15 16 17 18 |
# File 'lib/self_testing_framework/test_result.rb', line 14 def passed(klass_name, test_name) @passed_count += 1 @tests << {:class_name => klass_name, :test_name => test_name} @total_count += 1 end |