Skip to content

Commit

Permalink
Fix style in true/false/nil singleton_method specs
Browse files Browse the repository at this point in the history
* And add parens around receiver to avoid parse errors on some Rubies.
  • Loading branch information
eregon committed Sep 4, 2023
1 parent c306f21 commit 8182408
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions core/false/singleton_method_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
describe "FalseClass#singleton_method" do
ruby_version_is '3.3' do
it "raises regardless of whether FalseClass defines the method" do
proc{false.singleton_method(:foo)}.should raise_error(NameError)
-> { false.singleton_method(:foo) }.should raise_error(NameError)
begin
def false.foo; end
proc{false.singleton_method(:foo)}.should raise_error(NameError)
def (false).foo; end
-> { false.singleton_method(:foo) }.should raise_error(NameError)
ensure
FalseClass.send(:remove_method, :foo)
end
Expand Down
6 changes: 3 additions & 3 deletions core/nil/singleton_method_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
describe "NilClass#singleton_method" do
ruby_version_is '3.3' do
it "raises regardless of whether NilClass defines the method" do
proc{nil.singleton_method(:foo)}.should raise_error(NameError)
-> { nil.singleton_method(:foo) }.should raise_error(NameError)
begin
def nil.foo; end
proc{nil.singleton_method(:foo)}.should raise_error(NameError)
def (nil).foo; end
-> { nil.singleton_method(:foo) }.should raise_error(NameError)
ensure
NilClass.send(:remove_method, :foo)
end
Expand Down
6 changes: 3 additions & 3 deletions core/true/singleton_method_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
describe "TrueClass#singleton_method" do
ruby_version_is '3.3' do
it "raises regardless of whether TrueClass defines the method" do
proc{true.singleton_method(:foo)}.should raise_error(NameError)
-> { true.singleton_method(:foo) }.should raise_error(NameError)
begin
def true.foo; end
proc{true.singleton_method(:foo)}.should raise_error(NameError)
def (true).foo; end
-> { true.singleton_method(:foo) }.should raise_error(NameError)
ensure
TrueClass.send(:remove_method, :foo)
end
Expand Down

0 comments on commit 8182408

Please sign in to comment.