Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix ugly code. Closes #59 and #61

  • Loading branch information...
commit dafd90e1ff7cf245192c71205aaf9d6f39e71402 1 parent a299fe3
@aslakhellesoy aslakhellesoy authored coffeencoke committed
Showing with 3 additions and 7 deletions.
  1. +1 −0  History.txt
  2. +2 −7 lib/cucumber/formatter/junit.rb
View
1  History.txt
@@ -1,6 +1,7 @@
== In Git
=== New Features
+* Better JUnit formatter support for sub directories and scenario outlines (#59, #61 Matt Simpson)
* Coloured output that spans several lines sets colours for each line. (Aslak Hellesøy)
* New bundler attribute on the Rake task, allowing faster execution. (Aslak Hellesøy)
* Fix Table#rows cell ordering in ruby 1.8. (#47_github Brian Dunn)
View
9 lib/cucumber/formatter/junit.rb
@@ -57,13 +57,8 @@ def feature_name(keyword, name)
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 == ""
- @scenario = scenario_name
- description = "Scenario"
- description << " outline" if keyword.include?('Scenario Outline')
- @output = "#{description}: #{@scenario}\n\n"
+ @scenario = (name.nil? || name == "") ? "Unnamed scenario" : name.split("\n")[0]
+ @output = "#{keyword}: #{@scenario}\n\n"
end
def before_steps(steps)
Please sign in to comment.
Something went wrong with that request. Please try again.