Skip to content

Commit

Permalink
Add spec for module included into singleton ancestor chain
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Jul 2, 2011
1 parent 046f9f1 commit 4672d4f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/ruby/core/class/dup_spec.rb
Expand Up @@ -19,6 +19,19 @@ def self.message
klass_dup.message.should == "text"
end

it "retains an included module in the ancestor chain for the singleton class" do
klass = Class.new
mod = Module.new do
def hello
"hello"
end
end

klass.extend(mod)
klass_dup = klass.dup
klass_dup.hello.should == "hello"
end

it "retains the correct ancestor chain for the singleton class" do
super_klass = Class.new do
def hello
Expand Down

0 comments on commit 4672d4f

Please sign in to comment.