diff --git a/.rspec b/.rspec
index e41b078..5f16476 100644
--- a/.rspec
+++ b/.rspec
@@ -1,2 +1,2 @@
--color
---format=nested
+--format progress
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..f313f2a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+bundler_args: --without development
+before_install:
+ - gem update --system
+ - gem update bundler
+cache: bundler
+env:
+ global:
+ - JRUBY_OPTS="$JRUBY_OPTS --debug"
+language: ruby
+rvm:
+ - jruby-9000
+ - 2.2.9
+ - 2.3.6
+ - 2.4.3
+ - 2.5.0
+ - jruby-head
+ - ruby-head
+matrix:
+ allow_failures:
+ - rvm: jruby-head
+ - rvm: ruby-head
+ fast_finish: true
+sudo: false
diff --git a/Gemfile b/Gemfile
index 0df8091..402aaf2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,9 @@
source 'http://rubygems.org'
+gem 'rake', '~> 12.0'
+
platforms :jruby do
- gem 'jruby-openssl', '~> 0.7'
+ gem 'jruby-openssl', '~> 0.9'
end
gem 'ruby-openid', '2.1.8', :git => 'git://github.com/mbleigh/ruby-openid.git'
@@ -9,10 +11,11 @@ gem 'ruby-openid', '2.1.8', :git => 'git://github.com/mbleigh/ruby-openid.git'
gemspec
group :development, :test do
- gem 'guard'
- gem 'guard-rspec'
- gem 'growl'
- gem 'rb-fsevent'
+ gem 'rack-test'
+ gem 'rspec', '>= 3.0'
+ gem 'simplecov', '>= 0.9'
+ gem 'webmock', '~> 3.0'
+ gem 'yard', '>= 0.9.11'
end
group :example do
diff --git a/Gemfile.lock b/Gemfile.lock
index 06967e6..d06610d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -7,76 +7,81 @@ GIT
PATH
remote: .
specs:
- omniauth-openid (1.0.0.beta1)
- omniauth (~> 1.0.0.beta1)
- rack-openid (~> 1.3.1)
+ omniauth-openid (1.0.1)
+ omniauth (~> 1.0)
+ rack-openid (~> 1.4.0)
GEM
remote: http://rubygems.org/
specs:
- addressable (2.2.6)
- crack (0.3.1)
- diff-lcs (1.1.3)
- growl (1.0.3)
- guard (0.8.7)
- thor (~> 0.14.6)
- guard-rspec (0.5.0)
- guard (>= 0.8.4)
- hashie (1.2.0)
- multi_json (1.0.3)
- omniauth (1.0.0.pr2)
- hashie
- rack
- rack (1.3.5)
- rack-openid (1.3.1)
+ addressable (2.5.2)
+ public_suffix (>= 2.0.2, < 4.0)
+ crack (0.4.3)
+ safe_yaml (~> 1.0.0)
+ diff-lcs (1.3)
+ docile (1.1.5)
+ hashdiff (0.3.7)
+ hashie (3.5.7)
+ json (2.1.0)
+ mustermann (1.0.1)
+ omniauth (1.8.1)
+ hashie (>= 3.4.6, < 3.6.0)
+ rack (>= 1.6.2, < 3)
+ public_suffix (3.0.1)
+ rack (2.0.3)
+ rack-openid (1.4.2)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
- rack-protection (1.1.2)
+ rack-protection (2.0.0)
rack
- rack-test (0.6.1)
- rack (>= 1.0)
- rake (0.9.2)
- rb-fsevent (0.4.3.1)
- rdiscount (1.6.8)
- rspec (2.7.0)
- rspec-core (~> 2.7.0)
- rspec-expectations (~> 2.7.0)
- rspec-mocks (~> 2.7.0)
- rspec-core (2.7.0)
- rspec-expectations (2.7.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.7.0)
- simplecov (0.5.4)
- multi_json (~> 1.0.3)
- simplecov-html (~> 0.5.3)
- simplecov-html (0.5.3)
- sinatra (1.3.0)
- rack (~> 1.3)
- rack-protection (~> 1.1)
- tilt (~> 1.3)
- thor (0.14.6)
- tilt (1.3.3)
- webmock (1.7.7)
- addressable (> 2.2.5, ~> 2.2)
- crack (>= 0.1.7)
- yard (0.7.2)
+ rack-test (0.8.2)
+ rack (>= 1.0, < 3)
+ rake (12.3.0)
+ rspec (3.7.0)
+ rspec-core (~> 3.7.0)
+ rspec-expectations (~> 3.7.0)
+ rspec-mocks (~> 3.7.0)
+ rspec-core (3.7.0)
+ rspec-support (~> 3.7.0)
+ rspec-expectations (3.7.0)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.7.0)
+ rspec-mocks (3.7.0)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.7.0)
+ rspec-support (3.7.0)
+ safe_yaml (1.0.4)
+ simplecov (0.15.1)
+ docile (~> 1.1.0)
+ json (>= 1.8, < 3)
+ simplecov-html (~> 0.10.0)
+ simplecov-html (0.10.2)
+ sinatra (2.0.0)
+ mustermann (~> 1.0)
+ rack (~> 2.0)
+ rack-protection (= 2.0.0)
+ tilt (~> 2.0)
+ tilt (2.0.8)
+ webmock (3.1.1)
+ addressable (>= 2.3.6)
+ crack (>= 0.3.2)
+ hashdiff
+ yard (0.9.12)
PLATFORMS
ruby
DEPENDENCIES
- growl
- guard
- guard-rspec
- jruby-openssl (~> 0.7)
+ jruby-openssl (~> 0.9)
omniauth-openid!
- rack-test (~> 0.5)
- rake (~> 0.8)
- rb-fsevent
- rdiscount (~> 1.6)
- rspec (~> 2.5)
+ rack-test
+ rake (~> 12.0)
+ rspec (>= 3.0)
ruby-openid (= 2.1.8)!
- simplecov (~> 0.4)
+ simplecov (>= 0.9)
sinatra
- webmock (~> 1.7)
- yard (~> 0.7)
+ webmock (~> 3.0)
+ yard (>= 0.9.11)
+
+BUNDLED WITH
+ 1.15.4
diff --git a/omniauth-openid.gemspec b/omniauth-openid.gemspec
index 14036be..7c8237d 100644
--- a/omniauth-openid.gemspec
+++ b/omniauth-openid.gemspec
@@ -2,20 +2,12 @@
require File.expand_path('../lib/omniauth-openid/version', __FILE__)
Gem::Specification.new do |gem|
-
gem.add_dependency 'omniauth', '~> 1.0'
- gem.add_dependency 'rack-openid', '~> 1.3.1'
- gem.add_development_dependency 'rack-test', '~> 0.5'
- gem.add_development_dependency 'rake', '~> 0.8'
- gem.add_development_dependency 'rdiscount', '~> 1.6'
- gem.add_development_dependency 'rspec', '~> 2.7'
- gem.add_development_dependency 'simplecov', '~> 0.4'
- gem.add_development_dependency 'webmock', '~> 1.7'
- gem.add_development_dependency 'yard', '~> 0.7'
+ gem.add_dependency 'rack-openid', '~> 1.4.0'
- gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
+ gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober', 'Tom Milewski']
gem.description = %q{OpenID strategy for OmniAuth.}
- gem.email = ['michael@intridea.com', 'sferik@gmail.com']
+ gem.email = ['michael@intridea.com', 'sferik@gmail.com', 'tmilewski@gmail.com']
gem.files = `git ls-files`.split("\n")
gem.homepage = 'https://github.com/intridea/omniauth-openid'
gem.name = 'omniauth-openid'
diff --git a/spec/omniauth/strategies/open_id_spec.rb b/spec/omniauth/strategies/open_id_spec.rb
index e7843b8..d1e749d 100644
--- a/spec/omniauth/strategies/open_id_spec.rb
+++ b/spec/omniauth/strategies/open_id_spec.rb
@@ -6,7 +6,7 @@
def app
strat = OmniAuth::Strategies::OpenID
Rack::Builder.new {
- use Rack::Session::Cookie
+ use Rack::Session::Cookie, secret: 'foobar'
use strat
run lambda {|env| [404, {'Content-Type' => 'text/plain'}, [nil || env.key?('omniauth.auth').to_s]] }
}.to_app
@@ -22,55 +22,55 @@ def expired_query_string
end
it 'should respond with OK' do
- last_response.should be_ok
+ expect(last_response).to be_ok
end
it 'should respond with HTML' do
- last_response.content_type.should == 'text/html'
+ expect(last_response.content_type).to eq 'text/html'
end
it 'should render an identifier URL input' do
- last_response.body.should =~ %r{]*openid_url}
+ expect(last_response.body).to match %r{]*openid_url}
end
end
- #describe '/auth/open_id with an identifier URL' do
- # context 'successful' do
- # before do
- # @identifier_url = 'http://me.example.org'
- # # TODO: change this mock to actually return some sort of OpenID response
- # stub_request(:get, @identifier_url)
- # get '/auth/open_id?openid_url=' + @identifier_url
- # end
- #
- # it 'should redirect to the OpenID identity URL' do
- # last_response.should be_redirect
- # last_response.headers['Location'].should =~ %r{^#{@identifier_url}.*}
- # end
- #
- # it 'should tell the OpenID server to return to the callback URL' do
- # return_to = CGI.escape(last_request.url + '/callback')
- # last_response.headers['Location'].should =~ %r{[\?&]openid.return_to=#{return_to}}
- # end
- # end
- #end
+ # describe '/auth/open_id with an identifier URL' do
+ # context 'successful' do
+ # before do
+ # @identifier_url = 'http://me.example.org'
+ # # TODO: change this mock to actually return some sort of OpenID response
+ # stub_request(:get, @identifier_url)
+ # get '/auth/open_id?openid_url=' + @identifier_url
+ # end
+ #
+ # it 'should redirect to the OpenID identity URL' do
+ # last_response.should be_redirect
+ # last_response.headers['Location'].should =~ %r{^#{@identifier_url}.*}
+ # end
+ #
+ # it 'should tell the OpenID server to return to the callback URL' do
+ # return_to = CGI.escape(last_request.url + '/callback')
+ # last_response.headers['Location'].should =~ %r{[\?&]openid.return_to=#{return_to}}
+ # end
+ # end
+ # end
describe 'followed by /auth/open_id/callback' do
context 'successful' do
- #before do
- # @identifier_url = 'http://me.example.org'
- # # TODO: change this mock to actually return some sort of OpenID response
- # stub_request(:get, @identifier_url)
- # get '/auth/open_id/callback'
- #end
+ # before do
+ # @identifier_url = 'http://me.example.org'
+ # # TODO: change this mock to actually return some sort of OpenID response
+ # stub_request(:get, @identifier_url)
+ # get '/auth/open_id/callback'
+ # end
it "should set provider to open_id"
it "should create auth_hash based on sreg"
it "should create auth_hash based on ax"
- #it 'should call through to the master app' do
- # last_response.body.should == 'true'
- #end
+ # it 'should call through to the master app' do
+ # last_response.body.should == 'true'
+ # end
end
context 'unsuccessful' do
@@ -81,11 +81,10 @@ def expired_query_string
it 'it should redirect to invalid credentials' do
pending
- last_response.should be_redirect
- last_response.headers['Location'].should =~ %r{invalid_credentials}
+ expect(last_response).to be_redirect
+ expect(last_response).to match %r{invalid_credentials}
end
end
end
end
-
end