summaryrefslogtreecommitdiff
path: root/spec/ruby/core/nil/case_compare_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/nil/case_compare_spec.rb')
-rw-r--r--spec/ruby/core/nil/case_compare_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/core/nil/case_compare_spec.rb b/spec/ruby/core/nil/case_compare_spec.rb
new file mode 100644
index 0000000000..142560c6f5
--- /dev/null
+++ b/spec/ruby/core/nil/case_compare_spec.rb
@@ -0,0 +1,13 @@
+require_relative '../../spec_helper'
+
+describe "NilClass#===" do
+ it "returns true for nil" do
+ (nil === nil).should == true
+ end
+
+ it "returns false for non-nil object" do
+ (nil === 1).should == false
+ (nil === "").should == false
+ (nil === Object).should == false
+ end
+end