Sha256: d682b93c2e2394fcc006dfbfebfa8ae7bbdec570f83693efe3c43fe1b4c8059f

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

require "spec_helper"

describe AddThis::Configuration do

  let(:config) { AddThis::Configuration.new }
  let(:configure) do
    AddThis.configure do |config|
      config.user_id    = "chris"
      config.password   = "hein"
    end
  end
  
  context "instantiation" do

    it "should have a new method" do
      AddThis::Configuration.should respond_to :new
    end

    it "should return configuration object" do
      configure.should eq true
    end

  end

  context "attrs" do

    it "should have a attr of user_id" do
      config.should respond_to :user_id
    end

    it "should have an attr of password" do
      config.should respond_to :password
    end

  end
  
  context "getting the attrs" do
    
    it "should have access to the configuration variables for user_id" do
      AddThis.configuration.should respond_to :user_id
    end

    it "should have access to the configuration variables for password" do
      AddThis.configuration.should respond_to :password
    end

    it "should have chris for user_id" do
      AddThis.configuration.user_id.should eq "chris"
    end

    it "should have chris for password" do
      AddThis.configuration.password.should eq "hein"
    end

  end

  context "base class" do

    it "should have an attribute of configuration" do
      AddThis.should respond_to :configuration
    end
    
    it "should have a method for configure" do
      AddThis.should respond_to :configure
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
add_this-0.0.3 spec/add_this/configuration_spec.rb
add_this-0.0.2 spec/add_this/configuration_spec.rb
add_this-0.0.1 spec/add_this/configuration_spec.rb