mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
30ed82e772
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
15 lines
580 B
Ruby
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
|