initialize_dup/initialize_clone #1889

Closed
kachick opened this Issue Sep 6, 2012 · 2 comments

Comments

Projects
None yet
3 participants
Member

kachick commented Sep 6, 2012

This test-case passed under MRI(1.9.2, 1.9.3, 2.0trunk).
But failed under Rubinius(rubinius 2.0.0dev (1.9.3 163857d yyyy-mm-dd JI)).

Did we reject initialize_dup/initialize_clone ?

require 'test/unit'

class Test_Object_Copy < Test::Unit::TestCase

  def test_can_initialize_dup
    assert_same true, Object.new.respond_to?(:initialize_dup, true)
  end

  def test_can_initialize_clone
    assert_same true, Object.new.respond_to?(:initialize_clone, true)
  end

  def test_initialize_clone
    peep = nil
    obj = Object.new

    obj.singleton_class.class_eval do
      define_method :initialize_clone do |original|
        peep = :initialize_clone
      end
    end

    obj.clone
    assert_same :initialize_clone, peep
  end

end
Owner

dbussink commented Sep 16, 2012

We haven't implemented this for 1.9 mode yet. So no explicit reason, but we just haven't gotten to implementing it.

Member

carlosgaldino commented Sep 16, 2012

I'm working on it.

@dbussink dbussink closed this in 663e6cf Nov 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment