Skip to content

Instantly share code, notes, and snippets.

@kronos
Created March 10, 2010 00:32
Show Gist options
  • Save kronos/327331 to your computer and use it in GitHub Desktop.
Save kronos/327331 to your computer and use it in GitHub Desktop.
diff --git a/spec/ruby/language/defined_spec.rb b/spec/ruby/language/defined_spec.rb
index 66cfdfd..c9cdfd7 100644
--- a/spec/ruby/language/defined_spec.rb
+++ b/spec/ruby/language/defined_spec.rb
@@ -39,6 +39,10 @@ describe "The defined? keyword when called with a method name" do
defined?(Kernel.puts).should == "method"
end
+ it "returns nil if method is private" do
+ defined?(Object.print).should be_nil
+ end
+
it "returns nil if the method is not defined" do
defined?(Kernel.defined_specs_undefined_method).should be_nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment