Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCK: Reconcile parameter types #74

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions devkit/samples/parameter-types/parameter-types.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Feature: Parameter Types
Cucumber lets you define your own parameter types, which can be used
in Cucumber Expressions. This lets you define a precise domain-specific
vocabulary which can be used to generate a glossary with examples taken
from your scenarios. They also let you transform strings and tables into
rich types.
in Cucumber Expressions.

Scenario: flights
Given LHR-CDG has been delayed 45 minutes
This lets you define a precise domain-specific vocabulary which can be used to
generate a glossary with examples taken from your scenarios.

Parameter types also enable you to transform strings and tables into different types.

Scenario: Flight transformer
Given LHR-CDG has been delayed
3 changes: 1 addition & 2 deletions devkit/samples/parameter-types/parameter-types.feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ ParameterType({
},
})

Given('{flight} has been delayed {int} minutes', function (flight: Flight, delay: number) {
Given('{flight} has been delayed', function (flight: Flight) {
assert.strictEqual(flight.from, 'LHR')
assert.strictEqual(flight.to, 'CDG')
assert.strictEqual(delay, 45)
})
3 changes: 1 addition & 2 deletions ruby/features/parameter-types/parameter-types.feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def initialize(from, to)
transformer: ->(from, to) { Flight.new(from, to) }
)

Given('{flight} has been delayed {int} minutes') do |flight, delay|
Given('{flight} has been delayed') do |flight|
expect(flight.from).to eq('LHR')
expect(flight.to).to eq('CDG')
expect(delay).to eq(45)
end