mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
* lib/pp.rb (PP:ObjectMixin#pretty_print): delegates has no inspect
method. [ruby-core:25804] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
37c552e550
commit
4319c0235d
3 changed files with 34 additions and 2 deletions
|
@ -1,6 +1,9 @@
|
|||
require 'pp'
|
||||
require 'delegate'
|
||||
require 'test/unit'
|
||||
|
||||
module PPTestModule
|
||||
|
||||
class PPTest < Test::Unit::TestCase
|
||||
def test_list0123_12
|
||||
assert_equal("[0, 1, 2, 3]\n", PP.pp([0,1,2,3], '', 12))
|
||||
|
@ -178,3 +181,13 @@ class PPSingleLineTest < Test::Unit::TestCase
|
|||
assert_equal("[1#{', 1'*99}]", PP.singleline_pp([1]*100, ''))
|
||||
end
|
||||
end
|
||||
|
||||
class PPDelegateTest < Test::Unit::TestCase
|
||||
class A < DelegateClass(Array); end
|
||||
|
||||
def test_delegate
|
||||
assert_equal("[]\n", A.new([]).pretty_inspect, "[ruby-core:25804]")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue