Sha256: 3ceefef8afa4698156797f3387315adcc0bae52d875a07c10659895876e03077

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
require 'linode'

describe Linode::User do
  before :each do
    @api_key = 'foo'
    @linode = Linode::User.new(:api_key => @api_key)
  end
  
  it 'should be a Linode instance' do
    @linode.class.should < Linode
  end
  
  it 'should be able to return the API key for the connection' do
    @linode.should respond_to(:getapikey)
  end
  
  describe 'when returning the API key for the connection' do
    it 'should work without arguments' do
      lambda { @linode.getapikey }.should_not raise_error(ArgumentError)
    end
    
    it 'should not allow arguments' do
      lambda { @linode.getapikey(:foo) }.should raise_error(ArgumentError)      
    end
    
    it 'should return the api_key via the Linode handle' do
      @linode.stubs(:api_key).returns('foo')
      @linode.getapikey.should == 'foo'
    end
      
    it "should consider the documentation to live at http://www.linode.com/api/utility/user.getapikey" do
      @linode.documentation_path(Linode.action_path(@linode.class.name, 'getapikey')).should == "http://www.linode.com/api/utility/user.getapikey"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
linode-0.7.10 spec/linode/user_spec.rb
linode-0.7.9 spec/linode/user_spec.rb
linode-0.7.8 spec/linode/user_spec.rb
linode-0.7.7 spec/linode/user_spec.rb
linode-0.7.6 spec/linode/user_spec.rb
linode-0.7.5 spec/linode/user_spec.rb
linode-0.7.4 spec/linode/user_spec.rb
linode-0.7.3 spec/linode/user_spec.rb
linode-0.7.1 spec/linode/user_spec.rb
linode-0.7.0 spec/linode/user_spec.rb