Sha256: a5242cfdd352b7d0333166a161030c23c581f7a192330722552774f1709fceee

Contents?: true

Size: 947 Bytes

Versions: 60

Compression:

Stored size: 947 Bytes

Contents

require 'helper'

module Nutella
  
  class TestNutellaConfig < MiniTest::Test

    def setup
      @config = PersistedHash.new( 'runlist.json' )
    end


    should 'set a key value' do
      assert_equal 'value1', @config['key1']='value1'
    end

    should 'return \'nil\' if a key doesn\'t exist' do
      assert_nil @config['fakekey']
    end

    should 'return the value associated with a key whenever that key exists' do
      @config['key2']='value2'
      assert_equal 'value2', @config['key2']
    end

    should 'return true if a key exists' do
      @config['key3']='value3'
      assert @config.has_key?('key3')
    end

    should 'return false if a key doesn\'t exist' do
      refute @config.has_key?('key4')
    end

    should 'access nested hashes' do
      @config['key5']={'k55' => 'v55'}
      assert_equal 'v55', @config['key5']['k55']
    end


    def teardown
      @config.send(:remove_file)
    end
  
  end

end


Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
nutella_framework-0.6.8 test/config/test_persisted_hash.rb
nutella_framework-0.6.7 test/config/test_persisted_hash.rb
nutella_framework-0.6.6 test/config/test_persisted_hash.rb
nutella_framework-0.6.5 test/config/test_persisted_hash.rb
nutella_framework-0.6.4 test/config/test_persisted_hash.rb
nutella_framework-0.6.3 test/config/test_persisted_hash.rb
nutella_framework-0.6.2 test/config/test_persisted_hash.rb
nutella_framework-0.6.1 test/config/test_persisted_hash.rb
nutella_framework-0.6.0 test/config/test_persisted_hash.rb
nutella_framework-0.5.1 test/config/test_persisted_hash.rb
nutella_framework-0.5.0 test/config/test_persisted_hash.rb
nutella_framework-0.4.32 test/config/test_persisted_hash.rb
nutella_framework-0.4.31 test/config/test_persisted_hash.rb
nutella_framework-0.4.30 test/config/test_persisted_hash.rb
nutella_framework-0.4.29 test/config/test_persisted_hash.rb
nutella_framework-0.4.28 test/config/test_persisted_hash.rb
nutella_framework-0.4.27 test/config/test_persisted_hash.rb
nutella_framework-0.4.26 test/config/test_persisted_hash.rb
nutella_framework-0.4.25 test/config/test_persisted_hash.rb
nutella_framework-0.4.24 test/config/test_persisted_hash.rb