Skip to content

Commit

Permalink
Fix build for rack 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mkon committed Oct 4, 2022
1 parent 715f771 commit 581601d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/api_valve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
require 'faraday'
require 'multi_json'
require 'logger'
require 'rack'

module ApiValve
autoload :Benchmarking, 'api_valve/benchmarking'
Expand Down
2 changes: 1 addition & 1 deletion spec/examples/middlewares_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RSpec.describe 'Middleware example', type: :feature do
let(:builder) { example_app 'middleware' }
let(:app) { builder[0] }
let(:app) { builder }

before do
stub_request(:get, %r{^http://api.host/api})
Expand Down
2 changes: 1 addition & 1 deletion spec/examples/permissions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RSpec.describe 'Permissions example', type: :request do
let(:builder) { example_app 'permissions' }
let(:app) { builder[0] }
let(:app) { builder }

before do
stub_request(:get, %r{^http://api.host/api})
Expand Down
2 changes: 1 addition & 1 deletion spec/examples/rewriting_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RSpec.describe 'Rewriting example', type: :feature do
let(:builder) { example_app 'rewriting' }
let(:app) { builder[0] }
let(:app) { builder }

before do
stub_request(:get, %r{^http://api.host/api})
Expand Down
4 changes: 3 additions & 1 deletion spec/support/helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Helper
def example_app(example)
path = Pathname.new(__FILE__).join("../../../examples/#{example}/config.ru")
Rack::Builder.parse_file(path.to_s)
# In rack 2.x parse_file returns a tuple
app, _config = *Rack::Builder.parse_file(path.to_s)
app
end
end

0 comments on commit 581601d

Please sign in to comment.