Sha256: ad7e8914d0f14ad10b83bdf33e25491f38c81627a1196330bf7d15851a5b6f6f

Contents?: true

Size: 1.17 KB

Versions: 18

Compression:

Stored size: 1.17 KB

Contents

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

describe 'initialize' do
  before(:each) do
    @config_hash = {
      "test" => {
        :a => 1,
        :b => 2,
        :protocol => "http",
        :host => "localhost",
        :port => 3000,
        :namespace => "namespace"
      },
      "general" => {
        "verbosity" => ["verbose", "unused"],
        "priority" => 10
      }
    }
  end

  it 'should set instance variables for each config key value pair' do
    @a = ApiConfiguration.new(@config_hash, "test")
    @a.instance_variable_get(:@a).should == 1
    @a.instance_variable_get(:@b).should == 2
    @a.instance_variable_get(:@protocol).should == "http"
    @a.instance_variable_get(:@host).should == "localhost"
    @a.instance_variable_get(:@port).should == 3000
    @a.instance_variable_get(:@namespace).should == "namespace"
  end

  it 'should set verbosity correctly' do
    @a = ApiConfiguration.new(@config_hash, "test")
    @a.instance_variable_get(:@verbosity).should == "verbose"
  end

  it 'should set priority correctly' do
    @a = ApiConfiguration.new(@config_hash, "test")
    @a.instance_variable_get(:@priority).should == 10
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
apirunner-0.5.5 spec/api_configuration_spec.rb
apirunner-0.5.0 spec/api_configuration_spec.rb
apirunner-0.4.10 spec/api_configuration_spec.rb
apirunner-0.4.9 spec/api_configuration_spec.rb
apirunner-0.4.8 spec/api_configuration_spec.rb
apirunner-0.4.7 spec/api_configuration_spec.rb
apirunner-0.4.6 spec/api_configuration_spec.rb
apirunner-0.4.5 spec/api_configuration_spec.rb
apirunner-0.4.4 spec/api_configuration_spec.rb
apirunner-0.4.3 spec/api_configuration_spec.rb
apirunner-0.4.2 spec/api_configuration_spec.rb
apirunner-0.4.1 spec/api_configuration_spec.rb
apirunner-0.4.0 spec/api_configuration_spec.rb
apirunner-0.3.10 spec/api_configuration_spec.rb
apirunner-0.3.9 spec/api_configuration_spec.rb
apirunner-0.3.8 spec/api_configuration_spec.rb
apirunner-0.3.7 spec/api_configuration_spec.rb
apirunner-0.3.6 spec/api_configuration_spec.rb