Skip to content

Commit

Permalink
Tests: avoid passing passing params unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
orien committed Jan 13, 2025
1 parent e880301 commit 9620b48
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions spec/cucumber/glue/proto_world_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,24 @@ def object.to_s

describe 'when logging multiple items on one call' do
define_feature <<-FEATURE
Feature: Banana party
Feature: Logging multiple entries
Scenario: Monkey eats banana
When monkey eats banana
Scenario: Logging multiple entries
When logging multiple entries
FEATURE

define_steps do
When('{word} {word} {word}') do |subject, verb, complement|
log "subject: #{subject}", "verb: #{verb}", "complement: #{complement}"
When('logging multiple entries') do
log 'entry one', 'entry two', 'entry three'
end
end

it 'logs each parameter independently' do
expect(@out.string).to include [
' subject: monkey',
' verb: eats',
' complement: banana'
].join("\n")
it 'logs each entry independently' do
expect(@out.string).to include([
' entry one',
' entry two',
' entry three'
].join("\n"))
end
end

Expand Down

0 comments on commit 9620b48

Please sign in to comment.