Sha256: 5d0c2024af9d69cc889237a1a3c585c6c0b499f5301035ee5d8714312495b782

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe "NamecheapAPI Wrapper"  do
  describe "initializating settings" do

    before :each do
      Namecheap.reset
    end

    describe "with defaults" do
      it "should contain a username" do
        Namecheap.username.should == 'apiuser'
      end
      it "should contain a key" do
        Namecheap.key.should == 'apikey'
      end
      it "should contain a client_ip" do
        Namecheap.client_ip.should == '127.0.0.1'
      end
    end

    describe "with defaults overidden" do
      it "should contain an overidden key" do
        Namecheap.configure do |config|
          config.key = 'newkey'
        end

        Namecheap.key.should == 'newkey'
      end

      it "should contain an overridden username" do
        Namecheap.configure do |config|
          config.username = 'newuser'
        end

        Namecheap.username.should == 'newuser'
      end

      it "should contain an overridden client_ip" do
        Namecheap.configure do |config|
          config.client_ip = '192.168.0.1'
        end

        Namecheap.client_ip.should == '192.168.0.1'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
namecheap-0.2.0 spec/namecheap_spec.rb
namecheap-0.1.2 spec/namecheap_spec.rb
namecheap-0.1.1 spec/namecheap_spec.rb
namecheap-0.1.0 spec/namecheap_spec.rb