Sha256: 4866db2409e6544f2ca854724d59e4edbf9ffb67d9577ff4fdae31bef880bd57
Contents?: true
Size: 775 Bytes
Versions: 52
Compression:
Stored size: 775 Bytes
Contents
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) describe "Module#method_added" do it "is a private instance method" do Module.should have_private_instance_method(:method_added) end it "returns nil in the default implementation" do Module.new do method_added(:test).should == nil end end it "is called when a new method is defined in self" do begin $methods_added = [] m = Module.new do def self.method_added(name) $methods_added << name end def test() end def test2() end def test() end end $methods_added.should == [:test,:test2, :test] ensure $methods_added = nil end end end
Version data entries
52 entries across 52 versions & 2 rubygems