Sha256: 0f3d0248798b0397f776e494451744862fa0ab622ef3f8b0cfd12226a89fff55

Contents?: true

Size: 935 Bytes

Versions: 6

Compression:

Stored size: 935 Bytes

Contents

require 'spec_helper'

describe RubyWolf::Configuration do
  let(:configs) { RubyWolf::Configuration.new }

  describe '[]=' do
    context 'key not exists' do
      before do
        configs[:hihi] = 'Test'
      end

      it 'store the value under the key' do
        expect(configs[:hihi]).to eql('Test')
      end
    end

    context 'key exists' do
      before do
        configs[:hihi] = 'Test'
        configs[:hihi] = 'or not to test'
      end

      it 'updates the value under the key' do
        expect(configs[:hihi]).to eql('or not to test')
      end
    end
  end

  describe '[]' do
    context 'key exists' do
      before do
        configs[:hihi] = 'What'
      end

      it 'returns the value under the key' do
        expect(configs[:hihi]).to eql('What')
      end
    end

    context 'key not exists' do
      it 'returns nil' do
        expect(configs[:not_exist]).to eql(nil)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby_wolf-0.4.0 spec/ruby_wolf/configuration_spec.rb
ruby_wolf-0.3.3 spec/ruby_wolf/configuration_spec.rb
ruby_wolf-0.3.2 spec/ruby_wolf/configuration_spec.rb
ruby_wolf-0.3.1 spec/ruby_wolf/configuration_spec.rb
ruby_wolf-0.3.0 spec/ruby_wolf/configuration_spec.rb
ruby_wolf-0.2.0 spec/ruby_wolf/configuration_spec.rb