Skip to content

Commit

Permalink
CI: Refresh and repair builds
Browse files Browse the repository at this point in the history
* Fix incompatible backported specs
* Pin to Rake < 11.0 for 1.8 compat
* Switch to Travis container builds for newer Bundler
  * Fixes ye olde rubygems/bundler#3559
  * Allows us to use Bundler caching for faster builds
  * No longer needs sudo to manage packages
* Build on Ruby 2.3
* Allow failures on jruby-head and rbx-2
  • Loading branch information
jeremy committed Apr 18, 2016
1 parent 6712b86 commit b22e4fe
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
31 changes: 27 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
before_install: sudo apt-get install lighttpd libfcgi-dev libmemcache-dev memcached
install:
language: ruby
sudo: false
cache:
- bundler
- apt

services:
- memcached

addons:
apt:
packages:
- lighttpd
- libfcgi-dev

before_install:
- gem env version | grep '^\(2\|1.\(8\|9\|[0-9][0-9]\)\)' || gem update --system
- bundle install --jobs=3 --retry=3

script: bundle exec rake ci

rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1
- 2.2
- 2.2.4
- 2.3.0
- ruby-head
- rbx-2
- jruby
- jruby-9.0.4.0
- jruby-head
- ree

notifications:
email: false
irc: "irc.freenode.org#rack"

matrix:
allow_failures:
- rvm: rbx-2
- rvm: jruby-head
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ source 'https://rubygems.org'

gemspec

# Rake 11+ is Ruby 1.9+ only. Stick with 10.x to avoid awkward Bundler
# platform and RUBY_VERSION gymnastics, or separate Gemfiles.
gem "rake", "< 11.0"

# What we need to do here is just *exclude* JRuby, but bundler has no way to do
# this, because of some argument that I know I had with Yehuda and Carl years
# ago, but I've since forgotten. Anyway, we actually need it here, and it's not
Expand Down
4 changes: 2 additions & 2 deletions test/spec_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class RockLobster; end

should "raise LoadError if handler doesn't exist" do
lambda {
Rack::Handler.get('boom')
puts Rack::Handler.get('boom').inspect
}.should.raise(LoadError)

lambda {
Rack::Handler.get('Object')
puts Rack::Handler.get('Object').inspect
}.should.raise(LoadError)
end

Expand Down
16 changes: 8 additions & 8 deletions test/spec_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@
it "can set SameSite cookies with symbol value :lax" do
response = Rack::Response.new
response.set_cookie "foo", {:value => "bar", :same_site => :lax}
response["Set-Cookie"].must_equal "foo=bar; SameSite=Lax"
response["Set-Cookie"].should.equal "foo=bar; SameSite=Lax"
end

it "can set SameSite cookies with symbol value :Lax" do
response = Rack::Response.new
response.set_cookie "foo", {:value => "bar", :same_site => :lax}
response["Set-Cookie"].must_equal "foo=bar; SameSite=Lax"
response["Set-Cookie"].should.equal "foo=bar; SameSite=Lax"
end

it "can set SameSite cookies with string value 'Lax'" do
Expand All @@ -118,33 +118,33 @@
it "can set SameSite cookies with boolean value true" do
response = Rack::Response.new
response.set_cookie "foo", {:value => "bar", :same_site => true}
response["Set-Cookie"].must_equal "foo=bar; SameSite=Strict"
response["Set-Cookie"].should.equal "foo=bar; SameSite=Strict"
end

it "can set SameSite cookies with symbol value :strict" do
response = Rack::Response.new
response.set_cookie "foo", {:value => "bar", :same_site => :strict}
response["Set-Cookie"].must_equal "foo=bar; SameSite=Strict"
response["Set-Cookie"].should.equal "foo=bar; SameSite=Strict"
end

it "can set SameSite cookies with symbol value :Strict" do
response = Rack::Response.new
response.set_cookie "foo", {:value => "bar", :same_site => :Strict}
response["Set-Cookie"].must_equal "foo=bar; SameSite=Strict"
response["Set-Cookie"].should.equal "foo=bar; SameSite=Strict"
end

it "can set SameSite cookies with string value 'Strict'" do
response = Rack::Response.new
response.set_cookie "foo", {:value => "bar", :same_site => "Strict"}
response["Set-Cookie"].must_equal "foo=bar; SameSite=Strict"
response["Set-Cookie"].should.equal "foo=bar; SameSite=Strict"
end

it "validates the SameSite option value" do
response = Rack::Response.new
lambda {
response.set_cookie "foo", {:value => "bar", :same_site => "Foo"}
}.must_raise(ArgumentError).
message.must_match(/Invalid SameSite value: "Foo"/)
}.should.raise(ArgumentError).
message.should.match(/Invalid SameSite value: "Foo"/)
end

it "can set SameSite cookies with symbol value" do
Expand Down

0 comments on commit b22e4fe

Please sign in to comment.