Sha256: 817200a17617f87e04c9f06eaf374740933145aad49056d50fd924cb38d44626

Contents?: true

Size: 904 Bytes

Versions: 18

Compression:

Stored size: 904 Bytes

Contents

require 'spec_helper'

describe WCC::Auth do

  before(:each) do
    @previous_config = WCC::Auth.send(:instance_variable_get, :@config)
    @previous_callbacks = WCC::Auth.send(:instance_variable_get, :@finalize_callbacks)
  end

  after(:each) do
    WCC::Auth.send :instance_variable_set, :@config, @previous_config
    WCC::Auth.send :instance_variable_set, :@finalize_callbacks, @previous_callbacks
  end

  describe "::setup class method" do
    it "yields config with ::setup and sets it to ::config" do
      the_config = nil
      WCC::Auth.setup do |config|
        expect(config).to be_a(WCC::Auth::Config)
        the_config = config
      end
      expect(the_config).to eq(WCC::Auth.config)
    end

    it "calls finalize" do
      ping = nil
      WCC::Auth.finalize_callbacks << -> { ping = "pong" }
      WCC::Auth.setup { |config| }
      expect(ping).to eq("pong")
    end
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
wcc-auth-0.9.0 spec/wcc_auth_spec.rb
wcc-auth-0.8.3 spec/wcc_auth_spec.rb
wcc-auth-0.8.2 spec/wcc_auth_spec.rb
wcc-auth-0.8.1 spec/wcc_auth_spec.rb
wcc-auth-0.8.0 spec/wcc_auth_spec.rb
wcc-auth-0.7.3 spec/wcc_auth_spec.rb
wcc-auth-0.7.2 spec/wcc_auth_spec.rb
wcc-auth-0.7.1 spec/wcc_auth_spec.rb
wcc-auth-0.7.0 spec/wcc_auth_spec.rb
wcc-auth-0.6.0 spec/wcc_auth_spec.rb
wcc-auth-0.5.0 spec/wcc_auth_spec.rb
wcc-auth-0.4.0 spec/wcc_auth_spec.rb
wcc-auth-0.3.5 spec/wcc_auth_spec.rb
wcc-auth-0.3.4 spec/wcc_auth_spec.rb
wcc-auth-0.3.3 spec/wcc_auth_spec.rb
wcc-auth-0.3.2 spec/wcc_auth_spec.rb
wcc-auth-0.3.1 spec/wcc_auth_spec.rb
wcc-auth-0.3.0 spec/wcc_auth_spec.rb