diff options
Diffstat (limited to 'spec/ruby/library/set/pretty_print_cycle_spec.rb')
-rw-r--r-- | spec/ruby/library/set/pretty_print_cycle_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/library/set/pretty_print_cycle_spec.rb b/spec/ruby/library/set/pretty_print_cycle_spec.rb new file mode 100644 index 0000000000..a7eaab337b --- /dev/null +++ b/spec/ruby/library/set/pretty_print_cycle_spec.rb @@ -0,0 +1,10 @@ +require File.expand_path('../../../spec_helper', __FILE__) +require 'set' + +describe "Set#pretty_print_cycle" do + it "passes the 'pretty print' representation of a self-referencing Set to the pretty print writer" do + pp = mock("PrettyPrint") + pp.should_receive(:text).with("#<Set: {...}>") + Set[1, 2, 3].pretty_print_cycle(pp) + end +end |