Skip to content

Commit ab0b091

Browse files
committed
Fix style in true/false/nil singleton_method specs
* And add parens around receiver to avoid parse errors on some Rubies.
1 parent 3afc17d commit ab0b091

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

spec/ruby/core/false/singleton_method_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
describe "FalseClass#singleton_method" do
44
ruby_version_is '3.3' do
55
it "raises regardless of whether FalseClass defines the method" do
6-
proc{false.singleton_method(:foo)}.should raise_error(NameError)
6+
-> { false.singleton_method(:foo) }.should raise_error(NameError)
77
begin
8-
def false.foo; end
9-
proc{false.singleton_method(:foo)}.should raise_error(NameError)
8+
def (false).foo; end
9+
-> { false.singleton_method(:foo) }.should raise_error(NameError)
1010
ensure
1111
FalseClass.send(:remove_method, :foo)
1212
end

spec/ruby/core/nil/singleton_method_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
describe "NilClass#singleton_method" do
44
ruby_version_is '3.3' do
55
it "raises regardless of whether NilClass defines the method" do
6-
proc{nil.singleton_method(:foo)}.should raise_error(NameError)
6+
-> { nil.singleton_method(:foo) }.should raise_error(NameError)
77
begin
8-
def nil.foo; end
9-
proc{nil.singleton_method(:foo)}.should raise_error(NameError)
8+
def (nil).foo; end
9+
-> { nil.singleton_method(:foo) }.should raise_error(NameError)
1010
ensure
1111
NilClass.send(:remove_method, :foo)
1212
end

spec/ruby/core/true/singleton_method_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
describe "TrueClass#singleton_method" do
44
ruby_version_is '3.3' do
55
it "raises regardless of whether TrueClass defines the method" do
6-
proc{true.singleton_method(:foo)}.should raise_error(NameError)
6+
-> { true.singleton_method(:foo) }.should raise_error(NameError)
77
begin
8-
def true.foo; end
9-
proc{true.singleton_method(:foo)}.should raise_error(NameError)
8+
def (true).foo; end
9+
-> { true.singleton_method(:foo) }.should raise_error(NameError)
1010
ensure
1111
TrueClass.send(:remove_method, :foo)
1212
end

0 commit comments

Comments
 (0)