2
require 'cucumber/step_mother'
3
require 'gherkin/formatter/model'
14
def create_feature(dsl)
15
dsl.Given /^a (.*) step with an inline arg:$/ do |what, table|
17
dsl.Given /^a (.*) step$/ do |what|
18
flunk if what == 'failing'
24
table = Ast::Table.new([
28
doc_string = Ast::DocString.new(%{\n I like\nCucumber sandwich\n}, '')
29
location = Ast::Location.new('foo.feature', 2)
30
language = double.as_null_object
32
background = Ast::Background.new(
40
Step.new(language, location.on_line(3), "Given", "a passing step")
44
location = Location.new('features/pretty_printing.feature', 0)
49
Ast::Comment.new("# My feature comment\n"),
50
Ast::Tags.new(6, [Gherkin::Formatter::Model::Tag.new('one', 6), Gherkin::Formatter::Model::Tag.new('two', 6)]),
58
Ast::Comment.new(" # My scenario comment \n# On two lines \n"),
59
Ast::Tags.new(8, [Gherkin::Formatter::Model::Tag.new('three', 8), Gherkin::Formatter::Model::Tag.new('four', 8)]),
61
"Scenario:", "A Scenario", "",
63
Step.new(language, location.on_line(10), "Given", "a passing step with an inline arg:", table),
64
Step.new(language, location.on_line(11), "Given", "a happy step with an inline arg:", doc_string),
65
Step.new(language, location.on_line(12), "Given", "a failing step")