1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/library/set/shared/inspect.rb
eregon 30ed82e772 Update to ruby/spec@595645f
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-15 17:44:37 +00:00

15 lines
580 B
Ruby

describe "set_inspect", shared: true do
it "returns a String representation of self" do
Set[].send(@method).should be_kind_of(String)
Set[nil, false, true].send(@method).should be_kind_of(String)
Set[1, 2, 3].send(@method).should be_kind_of(String)
Set["1", "2", "3"].send(@method).should be_kind_of(String)
Set[:a, "b", Set[?c]].send(@method).should be_kind_of(String)
end
it "correctly handles self-references" do
(set = Set[]) << set
set.send(@method).should be_kind_of(String)
set.send(@method).should include("#<Set: {...}>")
end
end