Skip to content

Commit 1c9f6b9

Browse files
committed
Add spec for rb_class2name for anonymous classes.
1 parent ea16721 commit 1c9f6b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/ruby/optional/capi/class_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@
204204
it "returns a string for an anonymous class" do
205205
@s.rb_class2name(Class.new).should be_kind_of(String)
206206
end
207+
208+
it "returns a string beginning with # for an anonymous class" do
209+
@s.rb_class2name(Struct.new(:x, :y).new(1, 2).class).should.start_with?('#')
210+
end
207211
end
208212

209213
describe "rb_class_path" do

0 commit comments

Comments
 (0)