Skip to content

Commit 276805a

Browse files
authored
Merge pull request #2767 from ruby-grape/update_rubocop_1_88
Update rubocop to 1.88.0 and rubocop-rspec to 3.10.2
2 parents 6995daf + 2b36605 commit 276805a

6 files changed

Lines changed: 11 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#### Fixes
88

9+
* [#2767](https://github.com/ruby-grape/grape/pull/2767): Update rubocop to 1.88.0 and rubocop-rspec to 3.10.2 - [@ericproulx](https://github.com/ericproulx).
910
* Your contribution here.
1011

1112
### 3.3.0 (2026-06-20)

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ group :development, :test do
88
gem 'builder', require: false
99
gem 'bundler'
1010
gem 'rake'
11-
gem 'rubocop', '1.86.0', require: false
11+
gem 'rubocop', '1.88.0', require: false
1212
gem 'rubocop-performance', '1.26.1', require: false
13-
gem 'rubocop-rspec', '3.9.0', require: false
13+
gem 'rubocop-rspec', '3.10.2', require: false
1414
end
1515

1616
group :development do

spec/grape/api_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3691,8 +3691,8 @@ def self.call(object, _env)
36913691
mount app
36923692
end
36933693
expect(subject.routes.size).to eq(2)
3694-
expect(subject.routes.first.path).to match(%r{/cool/awesome})
3695-
expect(subject.routes.last.path).to match(%r{/cool/sauce})
3694+
expect(subject.routes.first.path).to include('/cool/awesome')
3695+
expect(subject.routes.last.path).to include('/cool/sauce')
36963696
end
36973697

36983698
it 'mounts on a path' do

spec/grape/validations/params_scope_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def initialize(value)
3939

4040
get '/types', foo: 'invalid'
4141
expect(last_response.status).to eq(400)
42-
expect(last_response.body).to match(/foo is invalid/)
42+
expect(last_response.body).to include('foo is invalid')
4343
end
4444
end
4545

spec/grape/validations/validators/oneof_validator_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@
8585
it 'rejects values that do not match any variant' do
8686
post '/pricing', { value: { time_unit: 'hour', rate: 'not-a-number' } }.to_json, 'CONTENT_TYPE' => 'application/json'
8787
expect(last_response.status).to eq(400)
88-
expect(JSON.parse(last_response.body)['error']).to match(/does not match any of the allowed schemas/)
88+
expect(JSON.parse(last_response.body)['error']).to include('does not match any of the allowed schemas')
8989
end
9090

9191
it 'rejects values with no matching keys' do
9292
post '/pricing', { value: { something_else: 1 } }.to_json, 'CONTENT_TYPE' => 'application/json'
9393
expect(last_response.status).to eq(400)
94-
expect(JSON.parse(last_response.body)['error']).to match(/does not match any of the allowed schemas/)
94+
expect(JSON.parse(last_response.body)['error']).to include('does not match any of the allowed schemas')
9595
end
9696

9797
it 'rejects when the value key is missing entirely' do
9898
post '/pricing', '{}', 'CONTENT_TYPE' => 'application/json'
9999
expect(last_response.status).to eq(400)
100-
expect(JSON.parse(last_response.body)['error']).to match(/value is missing/)
100+
expect(JSON.parse(last_response.body)['error']).to include('value is missing')
101101
end
102102
end
103103

spec/grape/validations_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,8 +1253,8 @@ def validate_param!(attr_name, params)
12531253
it 'throws the validation errors' do
12541254
get '/two_required'
12551255
expect(last_response.status).to eq(400)
1256-
expect(last_response.body).to match(/yolo is missing/)
1257-
expect(last_response.body).to match(/swag is missing/)
1256+
expect(last_response.body).to include('yolo is missing')
1257+
expect(last_response.body).to include('swag is missing')
12581258
end
12591259
end
12601260

0 commit comments

Comments
 (0)