diff --git a/lib/cucumber/formatter/junit.rb b/lib/cucumber/formatter/junit.rb index d0aa0e2d58..398d8d6e00 100644 --- a/lib/cucumber/formatter/junit.rb +++ b/lib/cucumber/formatter/junit.rb @@ -36,7 +36,7 @@ def before_test_case(test_case) def after_test_step(test_step, result) return if @failing_step_source - @failing_step_source = test_step.source.last if result.non_zero_exit_status?(@options[:strict]) + @failing_step_source = test_step.source.last unless result.ok?(@options[:strict]) end def after_test_case(test_case, result) @@ -86,7 +86,7 @@ def end_feature def create_output_string(test_case, scenario, result, row_name) output = "#{test_case.keyword}: #{scenario}\n\n" - return output unless result.non_zero_exit_status?(@options[:strict]) + return output if result.ok?(@options[:strict]) if test_case.keyword == "Scenario" output += "#{@failing_step_source.keyword}" unless hook?(@failing_step_source) output += "#{@failing_step_source.name}\n" @@ -107,7 +107,7 @@ def build_testcase(result, scenario_designation, output) name = scenario_designation @builder.testcase(:classname => classname, :name => name, :time => "%.6f" % duration) do - if !result.passed? && !result.non_zero_exit_status?(@options[:strict]) + if !result.passed? && result.ok?(@options[:strict]) @builder.skipped @skipped += 1 elsif !result.passed?