summaryrefslogtreecommitdiff
path: root/spec/ruby/core/kernel/match_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/kernel/match_spec.rb')
-rw-r--r--spec/ruby/core/kernel/match_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/core/kernel/match_spec.rb b/spec/ruby/core/kernel/match_spec.rb
new file mode 100644
index 0000000000..8a117ed497
--- /dev/null
+++ b/spec/ruby/core/kernel/match_spec.rb
@@ -0,0 +1,14 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe "Kernel#=~" do
+ it "returns nil matching any object" do
+ o = Object.new
+
+ (o =~ /Object/).should be_nil
+ (o =~ 'Object').should be_nil
+ (o =~ Object).should be_nil
+ (o =~ Object.new).should be_nil
+ (o =~ nil).should be_nil
+ (o =~ true).should be_nil
+ end
+end