Sha256: 1f706b485a1a3f95c4ce38caf4fc926489a480b773c51b29be76753fd8ef76d9

Contents?: true

Size: 831 Bytes

Versions: 10

Compression:

Stored size: 831 Bytes

Contents

require_relative '../_lib'

class Critic::Unit::RootTest < Critic::Unit::Test
  before do
    @root = Configatron::RootStore.new
  end

  describe 'delegation' do
    it 'passes on to Configatron::Store' do
      @root.a.b.c.d = 'D'
      assert_equal('D', @root.a.b.c.d)
    end
  end

  describe 'global configatron' do
    it 'returns an instance of Configatron::RootStore' do
      assert_equal(Configatron::RootStore.instance, configatron)
    end
  end

  describe 'inspect' do
    it 'delegates to store' do
      @root.a.b.c.d = 'D'
      @root.a.b.e = 'E'
      assert_equal('configatron.a.b.c.d = "D"
configatron.a.b.e = "E"', @root.inspect)
    end
  end

  describe 'to_s' do
    it 'delegates to store' do
      @root.a.b.c.d = 'D'
      @root.a.b = 'D'
      assert_equal('configatron', @root.to_s)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
configatron-4.5.1 test/unit/configatron/root_store.rb
configatron-4.5.0 test/unit/configatron/root_store.rb
configatron-4.4.1 test/unit/configatron/root_store.rb
configatron-4.4.0 test/unit/configatron/root_store.rb
configatron-4.3.0 test/unit/configatron/root_store.rb
configatron-4.2.1 test/unit/configatron/root_store.rb
configatron-4.2.0 test/unit/configatron/root_store.rb
configatron-4.1.1 test/unit/configatron/root_store.rb
configatron-4.1.0 test/unit/configatron/root_store.rb
configatron-4.0.3 test/unit/configatron/root_store.rb