Skip to content

Commit

Permalink
Added Rack version specs to ensure the correct version is loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Apr 26, 2024
1 parent 96c2a91 commit fa316c4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/integration/rack_2_0/headers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

describe Grape::Http::Headers, if: Gem::Version.new(Rack.release) < Gem::Version.new('3.0.0') do
describe Grape::Http::Headers do
it { expect(described_class::ALLOW).to eq('Allow') }
it { expect(described_class::LOCATION).to eq('Location') }
it { expect(described_class::TRANSFER_ENCODING).to eq('Transfer-Encoding') }
Expand Down
5 changes: 5 additions & 0 deletions spec/integration/rack_2_0/version_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

describe Rack do
it { expect(Gem::Version.new(described_class.release).segments.first).to eq 2 }
end
2 changes: 1 addition & 1 deletion spec/integration/rack_3_0/headers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

describe Grape::Http::Headers, if: Gem::Version.new(Rack.release) >= Gem::Version.new('3') do
describe Grape::Http::Headers do
it { expect(described_class::ALLOW).to eq('allow') }
it { expect(described_class::LOCATION).to eq('location') }
it { expect(described_class::TRANSFER_ENCODING).to eq('transfer-encoding') }
Expand Down
5 changes: 5 additions & 0 deletions spec/integration/rack_3_0/version_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

describe Rack do
it { expect(Gem::Version.new(described_class.release).segments.first).to eq 3 }
end

0 comments on commit fa316c4

Please sign in to comment.