rubyspec/rubyspec — pull request #180 by jamesotron (2013-02-25 01:17:52+00:00)
Title: Spec behaviour of Ruby 2.0's Module prepension

As of Ruby 2.0.0p0 you can call Class#prepend to insert a module at the
beginning of the ancestor chain (effectively allowing modules to
override instance methods).

For example:

```ruby
klass = Class.new do
def test
"foo"
end
end

mod = Module.new do
def test
"hello #{super}"
end
end

klass.send(:prepend, mod)

klass.ancestors
=> [#, #, Object, Kernel, BasicObject]

klass.new.test
=> "hello foo"
```

This spec verifies behaviour of calling prepend on a Class and that the
Module#prepended hook callback is called.