lib/jenkins/build/test_report.rb in jenkins-build-0.2.0.pre5 vs lib/jenkins/build/test_report.rb in jenkins-build-0.2.0.pre6
- old
+ new
@@ -76,16 +76,17 @@
path.empty? ? nil : path
end
end
class Status
+ FAILURES = %w[FAILED REGRESSION]
def initialize(status)
@status = status
end
def failure?
- @status == 'FAILED'.freeze
+ FAILURES.include?(@status)
end
def success?
@status == 'PASSED'.freeze
end
@@ -100,10 +101,10 @@
@root_path = longest_common_substr(stack_trace) || ''
end
def cause(project_path = root_path)
stack_trace.lazy.reverse_each.
- map { |path| relative_path(path, project_path) }.
+ map { |path| relative_path(path, project_path || root_path) }.
find(&method(:test_stack_frame?))
end
TEST_PATHS = %w[test spec features]