Skip to content

Commit 307b282

Browse files
committed
test: fix hash output format compatibility across Ruby versions
- Replace hardcoded hash strings with dynamic hash.inspect in RSpec matcher tests - Ensures test assertions work correctly with different Ruby hash formatting
1 parent bd9ce22 commit 307b282

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/enumerize/integrations/rspec/matcher_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ def self.name
107107
end
108108

109109
it 'rejects wrong keys' do
110-
message = 'Expected Model to define enumerize :sex in: "{:boy=>0, :girl=>1}"'
110+
message = "Expected Model to define enumerize :sex in: \"#{{boy: 0, girl: 1}.inspect}\""
111111
expect do
112112
expect(subject).to enumerize(:sex).in(boy: 0, girl: 1)
113113
end.to fail_with(message)
114114
end
115115

116116
it 'rejects wrong values' do
117-
message = 'Expected Model to define enumerize :sex in: "{:male=>2, :female=>3}"'
117+
message = "Expected Model to define enumerize :sex in: \"#{{male: 2, female: 3}.inspect}\""
118118
expect do
119119
expect(subject).to enumerize(:sex).in(male: 2, female: 3)
120120
end.to fail_with(message)

0 commit comments

Comments
 (0)