Permalink
Browse files

Fix ugly code. Closes #59 and #61

  • Loading branch information...
1 parent e35f39e commit bc378e36f1d29afd12b470cc95f7d0c568b8cd7f @aslakhellesoy aslakhellesoy committed May 22, 2011
Showing with 3 additions and 7 deletions.
  1. +1 −0 History.txt
  2. +2 −7 lib/cucumber/formatter/junit.rb
View
@@ -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)
@@ -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)

0 comments on commit bc378e3

Please sign in to comment.