blob: 16dc85d67c64b73da4b26c8c65a4462802e822d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
require_relative '../../spec_helper'
describe "FalseClass#singleton_method" do
it "raises regardless of whether FalseClass defines the method" do
-> { false.singleton_method(:foo) }.should raise_error(NameError)
begin
def (false).foo; end
-> { false.singleton_method(:foo) }.should raise_error(NameError)
ensure
FalseClass.send(:remove_method, :foo)
end
end
end
|