diff options
Diffstat (limited to 'spec/integration/omniauth/integration_spec.rb')
-rw-r--r-- | spec/integration/omniauth/integration_spec.rb | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/spec/integration/omniauth/integration_spec.rb b/spec/integration/omniauth/integration_spec.rb index 848a61b..a1298dd 100644 --- a/spec/integration/omniauth/integration_spec.rb +++ b/spec/integration/omniauth/integration_spec.rb @@ -2,33 +2,34 @@ ENV['RACK_ENV'] = 'test' require 'rspec/core' require 'rack/test' -require 'sinatra' -require 'omniauth' -class MyApplication < Sinatra::Base - use Rack::Session::Cookie, secret: 'hashie integration tests' - use OmniAuth::Strategies::Developer - - get '/' do - 'Hello World' +RSpec.configure do |config| + config.expect_with :rspec do |expect| + expect.syntax = :expect end end -module RSpecMixin +RSpec.describe 'omniauth' do 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 + let(:stdout) { StringIO.new } + + around(:each) do |example| + original_stdout = $stdout + $stdout = stdout + require_relative 'app' + example.run + $stdout = original_stdout + end + + it 'does not log anything to STDOUT when initializing' do + expect(stdout.string).to eq('') end -end -describe 'omniauth' do it 'works' do get '/' expect(last_response).to be_ok |