1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #6361 from markmcspadden/issue_6265

Remove special cases for duplicable? on Class and Module
This commit is contained in:
José Valim 2012-05-17 00:07:10 -07:00
commit 6950d74e18
2 changed files with 2 additions and 26 deletions

View file

@ -81,30 +81,6 @@ class Numeric
end end
end end
class Class
# Classes are not duplicable:
#
# c = Class.new # => #<Class:0x10328fd80>
# c.dup # => #<Class:0x10328fd80>
#
# Note +dup+ returned the same class object.
def duplicable?
false
end
end
class Module
# Modules are not duplicable:
#
# m = Module.new # => #<Module:0x10328b6e0>
# m.dup # => #<Module:0x10328b6e0>
#
# Note +dup+ returned the same module object.
def duplicable?
false
end
end
require 'bigdecimal' require 'bigdecimal'
class BigDecimal class BigDecimal
begin begin

View file

@ -5,8 +5,8 @@ require 'active_support/core_ext/numeric/time'
class DuplicableTest < ActiveSupport::TestCase class DuplicableTest < ActiveSupport::TestCase
RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, 5.seconds] RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, 5.seconds]
YES = ['1', Object.new, /foo/, [], {}, Time.now] YES = ['1', Object.new, /foo/, [], {}, Time.now, Class.new, Module.new]
NO = [Class.new, Module.new] NO = []
begin begin
bd = BigDecimal.new('4.56') bd = BigDecimal.new('4.56')