Sha256: 0fe2111cf738fb311b469e5cfa9a0dbe5c58d7e151a5d1efecee45478d502af0

Contents?: true

Size: 955 Bytes

Versions: 2

Compression:

Stored size: 955 Bytes

Contents

require 'spec_helper'

describe KcConfig do
  
  context "Simple Configuration" do
    before { KcConfig.load!( { foo: 'bar' } ) }
    it { KcSettings.get(:foo).should eql 'bar' }
    it { KcSettings.foo.should eql 'bar' }
  end

  context "Custom Configuration" do
    it "should have the default settings constant as 'KcSettings'" do
      KcConfig.const_name.should eql "KcSettings"
    end

    it "should be able to assign a different settings constant" do
      KcConfig.setup { |config| config.const_name = "AnotherSettingConstantName" }
      KcConfig.const_name.should == "AnotherSettingConstantName"
    end
  end
  
  context "KcWrapper" do
    let(:wrapper) { KcWrapper.new }
    before { wrapper.set(:key, 'value') }
    subject { wrapper.get(:key) }
    
    it "should have the value" do
      should eql 'value'
    end

    context "have method" do
      subject { wrapper }
      its(:key) { should eql 'value' }
    end
  end
    
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
korben-0.0.2 spec/korben/kc_config_spec.rb
korben-0.0.1 spec/korben/kc_config_spec.rb