Module: Oktobertest
- Defined in:
- lib/oktobertest.rb
Defined Under Namespace
Modules: Assertions
Classes: Scope, Test
Constant Summary
collapse
- VERSION =
'0.5.3'
- TestFailed =
Class.new StandardError
- TestSkipped =
Class.new StandardError
Class Method Summary
collapse
Class Method Details
.display_errors ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/oktobertest.rb', line 7
def self.display_errors
puts
errors.each do |error|
backtrace_location = error.backtrace_locations.detect { |l| l.base_label == '<main>' || l.base_label == '<top (required)>' }
print error.kind_of?(TestSkipped) ? "\nskip" : "\nerror: #{error.message}"
print "\nfile: #{backtrace_location.path}\nline: #{backtrace_location.lineno}\n"
end
end
|
.errors ⇒ Object
16
17
18
|
# File 'lib/oktobertest.rb', line 16
def self.errors
@errors ||= []
end
|
.exit_status ⇒ Object
20
21
22
|
# File 'lib/oktobertest.rb', line 20
def self.exit_status
errors.any? { |error| !error.kind_of?(TestSkipped) } ? 1 : 0
end
|