2018-03-04 10:09:32 -05:00
|
|
|
require_relative '../../spec_helper'
|
2017-05-07 08:04:49 -04:00
|
|
|
|
|
|
|
describe "Kernel#=~" do
|
2018-12-27 09:15:36 -05:00
|
|
|
verbose = $VERBOSE
|
|
|
|
before :each do
|
2018-12-27 09:18:16 -05:00
|
|
|
verbose, $VERBOSE = $VERBOSE, nil
|
2018-12-27 09:15:36 -05:00
|
|
|
end
|
|
|
|
after :each do
|
2018-12-27 09:18:16 -05:00
|
|
|
$VERBOSE = verbose
|
2018-12-27 09:15:36 -05:00
|
|
|
end
|
|
|
|
|
2017-05-07 08:04:49 -04:00
|
|
|
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
|