lib/cucumber/formatter/junit.rb in cucumber-0.6.4 vs lib/cucumber/formatter/junit.rb in cucumber-0.7.0.beta.1

- old
+ new

@@ -47,19 +47,20 @@ def after_background(*args) @in_background = false end - def feature_name(name) + def feature_name(keyword, name) raise UnNamedFeatureError.new(@current_feature.file) if name.empty? lines = name.split(/\r?\n/) - @feature_name = lines[0].sub(/Feature\:/, '').strip + @feature_name = lines[0] end def scenario_name(keyword, name, file_colon_line, source_indent) + # TODO: What's all this ugly weird code doing? Why not just use keyword and name???? scenario_name = name.strip.delete(".\r\n") - scenario_name = "Unnamed scenario" if name.blank? + scenario_name = "Unnamed scenario" if name == "" @scenario = scenario_name description = "Scenario" description << " outline" if keyword.include?('Scenario Outline') @output = "#{description}: #{@scenario}\n\n" end @@ -71,10 +72,10 @@ def after_steps(steps) return if @in_background || @in_examples duration = Time.now - @steps_start if steps.failed? - steps.each { |step| @output += "#{step.keyword} #{step.name}\n" } + steps.each { |step| @output += "#{step.keyword}#{step.name}\n" } @output += "\nMessage:\n" end build_testcase(duration, steps.status, steps.exception) end