diff options
author | dblock <dblock@dblock.org> | 2017-01-31 12:09:25 -0500 |
---|---|---|
committer | dblock <dblock@dblock.org> | 2017-01-31 12:57:18 -0500 |
commit | 9cc952f607450cf1bc955f41cec046bdd727e03a (patch) | |
tree | 9ed0097dc807da1651668d3843635f47edae6ba7 | |
parent | 3ec07c87281344ed64d814e588c5dc7ed03e7203 (diff) | |
download | hashie-9cc952f607450cf1bc955f41cec046bdd727e03a.tar.gz |
Added omniauth integration spec for #391.
-rw-r--r-- | .travis.yml | 5 | ||||
-rw-r--r-- | Rakefile | 1 | ||||
-rw-r--r-- | spec/integration/omniauth/.rspec | 3 | ||||
-rw-r--r-- | spec/integration/omniauth/Gemfile | 7 | ||||
-rw-r--r-- | spec/integration/omniauth/integration_spec.rb | 37 |
5 files changed, 53 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index 15118f7..499c299 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,11 @@ matrix: - bundle exec danger after_script: - bundle exec codeclimate-test-reporter + - rvm: 2.3.1 + install: + - for dir in spec/integration/*; do BUNDLE_GEMFILE=$dir/Gemfile bundle; done + script: + - for dir in spec/integration/*; do BUNDLE_GEMFILE=$dir/Gemfile bundle exec rspec $dir; done allow_failures: - rvm: ruby-head - rvm: jruby-head @@ -7,6 +7,7 @@ Bundler::GemHelper.install_tasks require 'rspec/core/rake_task' RSpec::Core::RakeTask.new do |spec| spec.pattern = 'spec/**/*_spec.rb' + spec.exclude_pattern = 'spec/integration/**/*_spec.rb' end require 'rubocop/rake_task' diff --git a/spec/integration/omniauth/.rspec b/spec/integration/omniauth/.rspec new file mode 100644 index 0000000..a4c51e7 --- /dev/null +++ b/spec/integration/omniauth/.rspec @@ -0,0 +1,3 @@ +--colour +--format=documentation +--pattern=*_spec.rb diff --git a/spec/integration/omniauth/Gemfile b/spec/integration/omniauth/Gemfile new file mode 100644 index 0000000..5e656f8 --- /dev/null +++ b/spec/integration/omniauth/Gemfile @@ -0,0 +1,7 @@ +source 'http://rubygems.org' + +gem 'hashie', path: '../../..' +gem 'omniauth', '~> 1.3.2' +gem 'sinatra' +gem 'rspec', '~> 3.5.0' +gem 'rack-test', '~> 0.6.3' diff --git a/spec/integration/omniauth/integration_spec.rb b/spec/integration/omniauth/integration_spec.rb new file mode 100644 index 0000000..469dd6e --- /dev/null +++ b/spec/integration/omniauth/integration_spec.rb @@ -0,0 +1,37 @@ +ENV['RACK_ENV'] = 'test' + +require 'rspec/core' +require 'rack/test' +require 'sinatra' +require 'omniauth' + +class MyApplication < Sinatra::Base + use Rack::Session::Cookie + use OmniAuth::Strategies::Developer + + get '/' do + 'Hello World' + end +end + +module RSpecMixin + include Rack::Test::Methods + def app + MyApplication + end +end + +RSpec.configure do |config| + config.include RSpecMixin + config.expect_with :rspec do |expect| + expect.syntax = :expect + end +end + +describe 'omniauth' do + it 'works' do + get '/' + expect(last_response).to be_ok + expect(last_response.body).to eq 'Hello World' + end +end |