Skip to content

Commit 4084ab4

Browse files
authored
ci: expand test coverage to Ruby 3.4 and Rails 7.2, fix RSpec hash formatting (#470)
* ci: add Ruby 3.4 and Rails 7.2 to test matrix - Add Ruby 3.4 to the test matrix - Add Gemfile.rails72 to test configurations * 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 aa69025 commit 4084ab4

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/ruby.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
ruby-version: ['3.1', '3.2', '3.3']
35+
ruby-version: ['3.1', '3.2', '3.3', '3.4']
3636
test: ['minitest', 'rspec']
3737
gemfile:
3838
- Gemfile.rails70
3939
- Gemfile.rails71
40+
- Gemfile.rails72
4041
- Gemfile.rails80
4142
- Gemfile.railsmaster
4243
- Gemfile.mongo_mapper

Gemfile.rails72

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
eval_gemfile('Gemfile.global')
2+
3+
gem 'minitest', '~> 5.8'
4+
gem 'rails', github: 'rails/rails', branch: '7-2-stable', require: false
5+
6+
gem 'mongoid', github: 'mongodb/mongoid'
7+
8+
gem 'sqlite3', platforms: [:ruby, :mswin, :mingw]

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)