Permalink
Browse files

9 failures

  • Loading branch information...
aslakhellesoy committed Apr 18, 2010
1 parent 7619d70 commit 3fab0e781b151e449c409b68e6ab986f7987ac11
@@ -5,6 +5,7 @@ Feature: Multiline description names
Scenario: multiline scenario
When I run cucumber features/multiline_name.feature --no-snippets
+ Then STDERR should be empty
Then it should pass with
"""
Feature: multiline
@@ -32,7 +32,7 @@ def accept(visitor)
return if Cucumber.wants_to_quit
init
visitor.visit_comment(@comment) unless @comment.empty?
- visitor.visit_background_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
+ visitor.visit_background_name(@keyword, @name, file_colon_line(@line), source_indent(text_length))
with_visitor(hook_context, visitor) do
visitor.step_mother.before(hook_context)
visitor.visit_steps(@step_invocations)
@@ -22,16 +22,16 @@ def text_length
name_line_lengths.max
end
- def first_line_length
- name_line_lengths[0]
- end
-
def name_line_lengths
if @name.strip.empty?
- [@keyword.jlength]
+ [Ast::Step::INDENT + @keyword.jlength + ': '.jlength]
else
@name.split("\n").enum_for(:each_with_index).map do |line, line_number|
- line_number == 0 ? @keyword.jlength + line.jlength : line.jlength + Ast::Step::INDENT - 1 # We -1 as names which are not keyword lines are missing a space between keyword and name
+ if line_number == 0
+ Ast::Step::INDENT + @keyword.jlength + ': '.jlength + line.jlength
+ else
+ Ast::Step::INDENT + Ast::Step::INDENT + line.jlength
+ end
end
end
end
@@ -45,7 +45,7 @@ def accept(visitor)
with_visitor(visitor) do
visitor.visit_comment(@comment) unless @comment.empty?
visitor.visit_tags(@tags)
- visitor.visit_scenario_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
+ visitor.visit_scenario_name(@keyword, @name, file_colon_line(@line), source_indent(text_length))
skip_invoke! if @background.failed?
visitor.step_mother.before_and_after(self, skip_hooks?) do
@@ -53,7 +53,7 @@ def accept(visitor)
return if Cucumber.wants_to_quit
visitor.visit_comment(@comment) unless @comment.empty?
visitor.visit_tags(@tags)
- visitor.visit_scenario_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
+ visitor.visit_scenario_name(@keyword, @name, file_colon_line(@line), source_indent(text_length))
visitor.visit_steps(@steps)
skip_invoke! if @background && @background.failed?
@@ -87,7 +87,7 @@ def visit_scenario_name(visitor, row)
@feature.language.scenario_keywords[0],
row.name,
file_colon_line(row.line),
- source_indent(first_line_length)
+ source_indent(text_length)
)
end
View
@@ -69,7 +69,7 @@ def source_indent
end
def text_length(name=@name)
- @keyword.jlength + name.jlength # + INDENT # Add indent as steps get indented more than scenarios
+ INDENT + INDENT + @keyword.jlength + name.jlength
end
def backtrace_line
@@ -18,7 +18,7 @@ module Ast
@keyword = "key"
@name = "short\nvery longer\ntiny"
- first_line_length.should == (@keyword.jlength) + (first_line_name_length = 5)
+ text_length.should == (@keyword.jlength) + (first_line_name_length = 5)
end
end

0 comments on commit 3fab0e7

Please sign in to comment.