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.9.2 test/config/test_persisted_hash.rb
nutella_framework-0.9.1 test/config/test_persisted_hash.rb
nutella_framework-0.9.0 test/config/test_persisted_hash.rb
nutella_framework-0.8.0 test/config/test_persisted_hash.rb
nutella_framework-0.7.3 test/config/test_persisted_hash.rb
nutella_framework-0.7.2 test/config/test_persisted_hash.rb
nutella_framework-0.7.1 test/config/test_persisted_hash.rb
nutella_framework-0.7.0 test/config/test_persisted_hash.rb
nutella_framework-0.6.21 test/config/test_persisted_hash.rb
nutella_framework-0.6.20 test/config/test_persisted_hash.rb
nutella_framework-0.6.19 test/config/test_persisted_hash.rb
nutella_framework-0.6.18 test/config/test_persisted_hash.rb
nutella_framework-0.6.17 test/config/test_persisted_hash.rb
nutella_framework-0.6.16 test/config/test_persisted_hash.rb
nutella_framework-0.6.15 test/config/test_persisted_hash.rb
nutella_framework-0.6.13 test/config/test_persisted_hash.rb
nutella_framework-0.6.12 test/config/test_persisted_hash.rb
nutella_framework-0.6.11 test/config/test_persisted_hash.rb
nutella_framework-0.6.10 test/config/test_persisted_hash.rb
nutella_framework-0.6.9 test/config/test_persisted_hash.rb