Sha256: 3afee9476cef3595c54725494baa4a7a381868fb32bdac9805912d88ea2ee3c9

Contents?: true

Size: 1 KB

Versions: 2

Compression:

Stored size: 1 KB

Contents

require 'helper'

module Nutella
  
  class TestNutellaConfig < MiniTest::Test
    
    def setup
      Nutella.config.send(:removeConfigFile)
    end
  
    should "set a key value" do
      assert_equal "value1", Nutella.config["key1"]="value1"
    end
  
    should "return 'nil' if a key doesn't exist" do   
      assert_nil Nutella.config["fakekey"]
    end

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

    should "retun true if a key exists" do
      Nutella.config["key3"]="value3"
      assert Nutella.config.has_key?("key3")
    end

    should "retun false if a key doens't exist" do
      refute Nutella.config.has_key?("key4")
    end
  
    should "access nested hashes" do
      Nutella.config["key5"]={"k55" => "v55"}
      assert_equal "v55", Nutella.config["key5"]["k55"]
    end
  
    def teardown
      Nutella.config.send(:removeConfigFile)
    end
  
  end
  
  
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nutella_framework-0.1.2 test/config/test_config.rb
nutella_framework-0.1.0 test/config/test_config.rb