class DuplicableTest

Constants

ALLOW_DUP
RAISE_DUP

Public Instance Methods

test_duplicable() click to toggle source
# File activesupport/test/core_ext/object/duplicable_test.rb, line 23
def test_duplicable
  rubinius_skip "* Method#dup is allowed at the moment on Rubinius\n" \
                "* https://github.com/rubinius/rubinius/issues/3089"

  RAISE_DUP.each do |v|
    assert !v.duplicable?, "#{ v.inspect } should not be duplicable"
    assert_raises(TypeError, v.class.name) { v.dup }
  end

  ALLOW_DUP.each do |v|
    assert v.duplicable?, "#{ v.class } should be duplicable"
    assert_nothing_raised { v.dup }
  end
end