In: |
pp.rb
|
Parent: | Test::Unit::TestCase |
# File pp.rb, line 555 def test_hasboth a = HasBoth.new(1) assert_equal("<pretty_print:1>\n", PP.pp(a, '')) end
# File pp.rb, line 545 def test_hasinspect a = HasInspect.new(1) assert_equal("<inspect:1>\n", PP.pp(a, '')) end
# File pp.rb, line 550 def test_hasprettyprint a = HasPrettyPrint.new(1) assert_equal("<pretty_print:1>\n", PP.pp(a, '')) end
# File pp.rb, line 560 def test_pretty_print_inspect a = PrettyPrintInspect.new(1) assert_equal("<pretty_print:1>", a.inspect) a = PrettyPrintInspectWithoutPrettyPrint.new assert_raise(RuntimeError) { a.inspect } end
# File pp.rb, line 572 def test_to_s_with_iv a = Object.new def a.to_s() "aaa" end a.instance_eval { @a = nil } result = PP.pp(a, '') assert_equal("#{a.inspect}\n", result) assert_match(/\A#<Object.*>\n\z/m, result) a = 1.0 a.instance_eval { @a = nil } result = PP.pp(a, '') assert_equal("#{a.inspect}\n", result) end