Skip to content

Commit

Permalink
Avoid exercising Ruby’s Hash#inspect method in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orien authored Jan 6, 2025
1 parent 8bfa286 commit 2f6b70a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions spec/cucumber/glue/proto_world_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,15 @@ def object.to_s

define_steps do
When('{word} {word} {word}') do |subject, verb, complement|
log "subject: #{subject}", "verb: #{verb}", "complement: #{complement}", subject: subject, verb: verb, complement: complement
log "subject: #{subject}", "verb: #{verb}", "complement: #{complement}"
end
end

it 'logs each parameter independently' do
expected_hash =
if RUBY_VERSION >= '3.4'
'{subject: "monkey", verb: "eats", complement: "banana"}'
else
'{:subject=>"monkey", :verb=>"eats", :complement=>"banana"}'
end
expect(@out.string).to include [
' subject: monkey',
' verb: eats',
' complement: banana',
" #{expected_hash}"
].join("\n")
end
end
Expand Down

0 comments on commit 2f6b70a

Please sign in to comment.