Skip to content

Instantly share code, notes, and snippets.

@febuiles
Created December 20, 2008 04:19
Show Gist options
  • Select an option

  • Save febuiles/38228 to your computer and use it in GitHub Desktop.

Select an option

Save febuiles/38228 to your computer and use it in GitHub Desktop.
it "defines a new method rather than changing visibility of an existing one" do
Module.new do
class A
def foo
end
end
class B < A
private :foo
end
A.new.foo
lambda { B.new.foo }.should raise_error(NoMethodError)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment