Gherkin extension for RSpec
Use Gherkin4 [GH-184]
*.feature
and *_steps.rb
)Nothing. No need to change your files.
[GH-185]
Turnip::Builder::Tag
class Turnip::Node::Tag
module Turnip::Node::HasTags
Usage:
class FooNode
include HasTags
end
FooNode
implements #tags
method.
Turnip::Builder::Line
class Turnip::Node::Location
module Turnip::Node::HasLocation
Usage:
class FooNode
include HasLocation
end
FooNode
implements #location
and #line
methods.
[GH-185]
Before class name (v2.1.1) | After class name (v3.0.0) | Maintain API compatibility? |
---|---|---|
Turnip::Builder::Feature |
Turnip::Node::Feature |
yes |
Turnip::Builder::Scenario |
Turnip::Node::Scenario |
yes |
Turnip::Builder::ScenarioOutline |
Turnip::Node::ScenarioOutline |
yes |
Turnip::Builder::Background |
Turnip::Node::Background |
yes |
Turnip::Builder::Step |
Turnip::Node::Step |
no (under-mentioned) |
Turnip::Node::HasTags
API [GH-186]
# before (Turnip::Builder::Tag)
node.tags # => ['tag1', 'tag2']
# after (Turnip::Node::HasTags)
node.tags # => [<Turnip::Node::Tag>, <Turnip::Node::Tag>]
node.tag_names # => ['tag1', 'tag2']
Turnip::Node::Step
API [GH-185]
# before (Turnip::Builder::Step)
step.extra_args # => `Array<String>` or `Turnip::Table`
# after (Turnip::Node::Step)
step.argument # => `nil` , `String` or `Turnip::Table`
Turnip::Builder
API [GH-187]
# before
builder = Turnip::Builder.build(feature_file)
builder.features # => Array<Turnip::Builder::Feature>
# after
feature = Turnip::Builder.build(feature_file) # => Turnip::Node::Feature
Turnip::Builder::XXX
=== Gherkin::Ast::XXX
A feature node is created per a gherkin document. [GH-187]
Nothing 🎉 (No change of *.feature
and *_.steps.rb
)
Until v2.1.1:
builder = Turnip::Builder.build(feature_file)
builder.features # Array of Feature Node
v3.0.0:
feature = Turnip::Builder.build(feature_file)
Turnip::Builder::XXX
=== Gherkin::Ast::XXX
Add Turnip::Node::Tag#tag_names [GH-186]
Until v2.1.1:
feature.tags # => ['tag1', 'tag2']
v3.0.0:
feature.tags # => [<Turnip::Node::Tag>, <Turnip::Node::Tag>]
feature.tag_names # => ['tag1', 'tag2']
Turnip::Builder::XXX
=== Gherkin::Ast::XXX
[Refactoring] Turnip::Node that is corresponding to Gherkin4 nodes in AST [GH-185]
Nothing 🎉 (No change of *.feature
and *_.steps.rb
)
Turnip::Builder::Tag
Recreate class Turnip::Node::Tag
and module Turnip::Node::HasTags
Change usage:
class FooNode
- include Tag
+ include HasTags
end
FooNode
implements tags
method.
Turnip::Builder::Line
Recreate class Turnip::Node::Location
and module Turnip::Node::HasLocation
Change usage:
class FooNode
- include Line
+ include HasLocation
end
FooNode
implements location
and line
methods.
Turnip::Builder::Name
Turnip::Builder::Feature
Turnip::Node::Feature
Turnip::Builder::Scenario
Turnip::Node::Scenario
Turnip::Builder::ScenarioOutline
Turnip::Node::ScenarioOutline
Turnip::Builder::Background
Turnip::Node::Background
Turnip::Builder::Step
Turnip::Node::Step
step.extra_args
(return Array of String or Turnip::Table
)step.argument
(return nil
, String
or Turnip::Table
)