method
print_step
rspec latest stable - Class:
Spec::Runner::Formatter::Story::HtmlFormatter
print_step(klass, type, description, *args)public
No documentation available.
# File lib/spec/runner/formatter/story/html_formatter.rb, line 159
def print_step(klass, type, description, *args)
spans = args.map { |arg| "<span class=\"param\">#{arg}</span>" }
desc_string = description.step_name
arg_regexp = description.arg_regexp
inner = if(type == @previous_type)
"And "
else
"#{type.to_s.capitalize} "
end
i = -1
inner += desc_string.gsub(arg_regexp) { |param| spans[i+=1] }
@scenario_text += " <li class=\"#{klass}\">#{inner}</li>\n"
if type == 'given scenario''given scenario'
@previous_type = :given
else
@previous_type = type
end
end