Sha256: eea96158d4c96a31bb86a0d8a6246f015fb9f89420f7883b99e459ca8cc4fa1b

Contents?: true

Size: 703 Bytes

Versions: 5

Compression:

Stored size: 703 Bytes

Contents

require 'test_helper'

module DiviningRod
  class MashTest < Test::Unit::TestCase
    context 'Mash is like Hash' do
      should "work that way" do
        mash = Mash.new({:a_key => "and a value"})
        and_mash = Mash.new({:my_key => "and my value"})
        assert_equal ({:a_key => "and a value", :my_key => "and my value"}), mash.merge(and_mash)
      end

      should "also mash tags" do
        mash = Mash.new({:tags => :foo})
        and_mash = Mash.new({:tags => [:bar, :baz]})
        assert_equal mash.merge(and_mash), {:tags => [:foo, :bar, :baz]}
      end

      should "accept nil happily" do
        mash = Mash.new(nil)
        assert_equal({}, mash)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
divining_rod-0.6.4 test/test_mash.rb
divining_rod-0.6.3 test/test_mash.rb
divining_rod-0.6.2 test/test_mash.rb
divining_rod-0.6.1 test/test_mash.rb
divining_rod-0.6.0 test/test_mash.rb