Sha256: 8d72c0ca6f9ddb632d34da363545c450a586bf96a15ed26676acd825dcaaf199

Contents?: true

Size: 715 Bytes

Versions: 1

Compression:

Stored size: 715 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facet/ostruct/__merge__.rb
#
# Extracted Wed Jan 25 11:25:39 EST 2006
# Unit Tools Reap Test Extractor
#

require 'facet/ostruct/__merge__.rb'


  require 'test/unit'

  class TC_OpenStruct < Test::Unit::TestCase

    def test_merge_1
      o = OpenStruct.new( { :a => 1 } )
      h = { :b => 2 }
      q = o.__merge__( h )
      assert_equal( 1, q.a )
      assert_equal( 2, q.b )
    end

    def test_merge_2
      o1 = OpenStruct.new( { :a => 1 } )
      o2 = OpenStruct.new( { :b => 2 } )
      q = o1.__merge__( o2 )
      assert_equal( 1, q.a )
      assert_equal( 2, q.b )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.0.3 packages/core/test/lib/facet/ostruct/test___merge__.rb