Skip to content

Commit

Permalink
Fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
pacso committed Apr 25, 2024
1 parent 900c8a9 commit 1796938
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/examples/occurrence_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
time_now = Time.current
occurrence = Occurrence.new(time_now)

expect(occurrence.to_s(:short)).to eq time_now.to_s(:short)
# From Rails 7.1 onwards, support for format options was removed
if time_now.public_method(:to_s).arity != 0
expect(occurrence.to_s(:short)).to eq time_now.to_s(:short)
else
expect(occurrence.to_s(:short)).to eq time_now.to_s
end
end
end

Expand Down

0 comments on commit 1796938

Please sign in to comment.