diff options
Diffstat (limited to 'spec/ruby/core/kernel/not_match_spec.rb')
| -rw-r--r-- | spec/ruby/core/kernel/not_match_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/kernel/not_match_spec.rb b/spec/ruby/core/kernel/not_match_spec.rb index 906f18df2c..4ed7ea7b42 100644 --- a/spec/ruby/core/kernel/not_match_spec.rb +++ b/spec/ruby/core/kernel/not_match_spec.rb @@ -14,6 +14,10 @@ describe "Kernel#!~" do (obj !~ :foo).should == false end + it "raises NoMethodError if self does not respond to #=~" do + -> { Object.new !~ :foo }.should.raise(NoMethodError) + end + it 'can be overridden in subclasses' do obj = KernelSpecs::NotMatch.new (obj !~ :bar).should == :foo |
