Skip to content

Commit 9fe1e5c

Browse files
committed
Simplify spec and make it consistent with the one below
1 parent 161be68 commit 9fe1e5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/ruby/core/struct/shared/inspect.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
end
1010

1111
it "returns a string representation without the class name for structs nested in anonymous classes" do
12-
obj = Object.new
13-
obj.singleton_class.class_eval <<~DOC
12+
c = Class.new
13+
c.class_eval <<~DOC
1414
class Foo < Struct.new(:a); end
1515
DOC
1616

17-
obj.singleton_class::Foo.new("").send(@method).should == '#<struct a="">'
17+
c::Foo.new("").send(@method).should == '#<struct a="">'
1818
end
1919

2020
it "returns a string representation without the class name for structs nested in anonymous modules" do

0 commit comments

Comments
 (0)