Skip to content

Commit

Permalink
Update rubocop-rspec → 2.23.0 (unknown) (#198)
Browse files Browse the repository at this point in the history
* Update rubocop-rspec to version 2.23.0

* rubocop

---------

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Konstantin Munteanu <[email protected]>
  • Loading branch information
depfu[bot] and mkon authored Aug 7, 2023
1 parent 2f87332 commit bcd5048
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api_valve.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rackup'
s.add_development_dependency 'rspec', '~> 3.7'
s.add_development_dependency 'rubocop', '1.55.1'
s.add_development_dependency 'rubocop-rspec', '2.19.0'
s.add_development_dependency 'rubocop-rspec', '2.23.0'
s.add_development_dependency 'simplecov', '~> 0.16'
s.add_development_dependency 'timecop', '~> 0.9'
s.add_development_dependency 'webmock', '~> 3.4'
Expand Down
20 changes: 10 additions & 10 deletions spec/api_valve/route_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
subject(:route_set) { described_class.new }

let(:rack_response) { [200, {'Content-Type' => 'text/plain'}, ['OK']] }
let(:route_proc) { proc { rack_response } } # rubocop:disable RSpec/VerifiedDoubles
let(:route_proc) { proc { rack_response } }

before do
allow(route_proc).to receive(:call).and_call_original
Expand Down Expand Up @@ -47,20 +47,20 @@
end

it 'raises ApiValve::Error::NotFound if no patch matches' do
expect {
expect do
subject.match(env.merge('PATH_INFO' => '/notexists'))
}.to raise_error(ApiValve::Error::NotRouted)
end.to raise_error(ApiValve::Error::NotRouted)
end
end
end
end

describe '#unshift' do
let(:define_routes) do
route_set.get(%r{^/start}, {}, &proc1)
route_set.get(%r{^/start}, {}, &proc_one)
end
let(:proc1) { proc { rack_response } }
let(:proc2) { proc { rack_response } }
let(:proc_one) { proc { rack_response } }
let(:proc_two) { proc { rack_response } }
let(:env) do
{
'PATH_INFO' => '/start',
Expand All @@ -69,15 +69,15 @@
end

before do
[proc1, proc2].each { |pr| allow(pr).to receive(:call).and_call_original }
[proc_one, proc_two].each { |pr| allow(pr).to receive(:call).and_call_original }
end

it 'adds the route the the front' do
route_set.unshift(:get, %r{^/start}, {}, &proc2)
route_set.unshift(:get, %r{^/start}, {}, &proc_two)
route, _match_data = route_set.match(env)
route.call
expect(proc1).not_to have_received(:call)
expect(proc2).to have_received(:call)
expect(proc_one).not_to have_received(:call)
expect(proc_two).to have_received(:call)
end
end
end

0 comments on commit bcd5048

Please sign in to comment.