File: integration_spec.rb

package info (click to toggle)
ruby-hashie 5.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 884 kB
  • sloc: ruby: 7,049; sh: 8; makefile: 6
file content (38 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ENV['RACK_ENV'] = 'test'

require 'rspec/core'
require 'rack/test'

RSpec.configure do |config|
  config.expect_with :rspec do |expect|
    expect.syntax = :expect
  end
end

RSpec.describe 'omniauth' do
  include Rack::Test::Methods

  def app
    MyApplication
  end

  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

  it 'works' do
    get '/'
    expect(last_response).to be_ok
    expect(last_response.body).to eq 'Hello World'
  end
end