Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

initialize_dup/initialize_clone #1889

Closed
kachick opened this Issue · 2 comments

3 participants

@kachick
Collaborator

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
@dbussink
Owner

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

@carlosgaldino
Collaborator

I'm working on it.

@dbussink dbussink closed this in 663e6cf
@Gibheer Gibheer referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.