Module: AutoTest::Error
- Included in:
- AutoTest
- Defined in:
- lib/error.rb
Class Method Summary collapse
- .get_error ⇒ Object
- .get_error_messages ⇒ Object
-
.inc_error(value) ⇒ Object
increment the errorcount in the first field of the array, add error messages.
- .init_error ⇒ Object
- .print_errors ⇒ Object
Class Method Details
.get_error ⇒ Object
36 37 38 |
# File 'lib/error.rb', line 36 def get_error @error[0] end |
.get_error_messages ⇒ Object
40 41 42 |
# File 'lib/error.rb', line 40 def @error[1..@error.size-1] end |
.inc_error(value) ⇒ Object
increment the errorcount in the first field of the array, add error messages
8 9 10 11 12 13 14 15 16 |
# File 'lib/error.rb', line 8 def inc_error(value) if !.include? value then @error[0] = @error[0] + 1 @error << value if Test.stop_at_first_error? then Test.stop! end end end |
.init_error ⇒ Object
44 45 46 |
# File 'lib/error.rb', line 44 def init_error @error = [0] end |
.print_errors ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/error.rb', line 18 def print_errors if get_error > 0 then if get_error == 1 then puts "There was 1 Error in this test:" .each do |m| puts m end else puts "There were " + get_error.to_s + " Errors in this test:" .each do |m| puts m end end else puts "There were no errors in this test" end end |