Sha256: 293e10868b1d9d81d6103d5ecbec1239b3076864123f8552697d6b65a32347a9

Contents?: true

Size: 982 Bytes

Versions: 2

Compression:

Stored size: 982 Bytes

Contents

require 'spec_helper'

describe Namba do

  before(:each) do
    Namba.configure do |config|
      config.username = nil
      config.password = nil
      config.locale = nil
    end 
  end

  it "should set configuration information" do
    Namba.configure do |config|
      config.username = "name"
      config.password = "secret"
      config.locale = :kz
    end

    n = Namba.new()

    n.username.should == "name"    
    n.password.should == "secret"
    n.locale.should == :kz
  end

  it "should set defaults when it is not set in configuration block" do
    Namba.configure do |config|
    end

    n = Namba.new()

    n.username.should == ""    
    n.password.should == ""
    n.locale.should == :kg
  end

  it "should not allow to set any locale except :kg or :kz" do
    expect {     
      Namba.configure do |config|
        config.locale = :ru
      end 
    }.should raise_error(Namba::ConfigurationError, "Available locales are only 'kg' and 'kz'")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
namba-1.0.0.1 spec/namba/namba_spec.rb
namba-1.0.0 spec/namba/namba_spec.rb