diff options
Diffstat (limited to 'spec/rubyspec/core/kernel/match_spec.rb')
-rw-r--r-- | spec/rubyspec/core/kernel/match_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/rubyspec/core/kernel/match_spec.rb b/spec/rubyspec/core/kernel/match_spec.rb new file mode 100644 index 0000000000..8a117ed497 --- /dev/null +++ b/spec/rubyspec/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 |