HomePhorge

(#6830) Fix tests that depended on special inherited behavior
1ac7f63f00c5Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#6830) Fix tests that depended on special inherited behavior

class Foo
  def self.inherited(subclass)
    puts "#{subclass.inspect} inherited from #{self}"
  end
end

class Bar < Foo
end

a = Class.new(Bar) do
  def self.to_s
    "some other class"
  end
end

In Ruby 1.9 this prints

Bar inherited from Foo
#<Class:0x0000010086c198> inherited from Bar

In Ruby 1.8 the to_s override used to be in effect so printed:

Bar inherited from Foo
some other class inherited from Bar

Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>

Details

Provenance
Matt Robinson <matt@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU29f3dda2aaa4: (#6830) Fix overly stubbed tests
Branches
Unknown
Tags
Unknown

Event Timeline

Matt Robinson <matt@puppetlabs.com> committed rPU1ac7f63f00c5: (#6830) Fix tests that depended on special inherited behavior (authored by Matt Robinson <matt@puppetlabs.com>).Mar 29 2011, 8:00 PM