Sha256: 6e1165a4c6f18f03eedcbc43547f444affdb0dca899d405b9a6bd2e60ac0c959

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

shared_examples_for "an oauth strategy" do
  it 'should be initializable with only three arguments' do
    lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret') }.should_not raise_error
  end

  it 'should be initializable with a block' do
    lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}){|s| s.consumer_key = 'abc'} }.should_not raise_error
  end

  it 'should handle the setting of client options' do
    s = strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret', :client_options => {:abc => 'def'})
    s.consumer.options[:abc].should == 'def'
  end
end

shared_examples_for "an oauth2 strategy" do
  it 'should be initializable with only three arguments' do
    lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret') }.should_not raise_error
  end

  it 'should be initializable with a block' do
    lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}){|s| s.client_id = 'abc'} }.should_not raise_error
  end

  it 'should handle the setting of client options' do
    s = strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret', :client_options => {:abc => 'def'})
    s.client.options[:abc].should == 'def'
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
oa-oauth-0.3.2 spec/support/shared_examples.rb
oa-oauth-0.3.0 spec/support/shared_examples.rb
oa-oauth-0.3.0.rc3 spec/support/shared_examples.rb
omniauth-0.2.6 oa-oauth/spec/support/shared_examples.rb
oa-oauth-0.2.6 spec/support/shared_examples.rb
omniauth-0.2.5 oa-oauth/spec/support/shared_examples.rb
oa-oauth-0.2.5 spec/support/shared_examples.rb