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