Sha256: 9cd48f7f933bce2ffe8a2928e24a4a4dc46506ea86c1daf7db87b43f65cd58ba

Contents?: true

Size: 451 Bytes

Versions: 2

Compression:

Stored size: 451 Bytes

Contents

require 'facets/kernel/assign_from.rb'
require 'test/unit'

class TestKernelAssignFrom < Test::Unit::TestCase

  C = Struct.new(:name, :address, :zip)

  def test_assign_from
    bob = C.new("Bob Sawyer", "123 Maple, Anytown NC", 12345)
    joe = C.new("Joe Pitare")

    joe.assign_from(bob, :address, :zip)

    assert_equal("Joe Pitare", joe.name)
    assert_equal("123 Maple, Anytown NC", joe.address)
    assert_equal(12345, joe.zip)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/kernel/test_assign_from.rb
facets-2.8.3 test/core/kernel/test_assign_from.rb