summaryrefslogtreecommitdiff
path: root/test/ostruct/test_ostruct.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:13:57 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:13:57 +0000
commit5b5de3984e31b75643ad3ffc97c149436498c33d (patch)
tree1ec99510b69b75708f76fb1b6b991df3dd5300e8 /test/ostruct/test_ostruct.rb
parent99d5d90f2f8d61d37b6eb110b54d84a08de5a4d1 (diff)
* lib/ostruct.rb (Struct#each_pair): Return an enumerator with size
Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ostruct/test_ostruct.rb')
-rw-r--r--test/ostruct/test_ostruct.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index 3c1d574e32..a28abe5211 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -113,6 +113,7 @@ class TC_OpenStruct < Test::Unit::TestCase
os = OpenStruct.new(h)
assert_equal '#<Enumerator: #<OpenStruct name="John Smith", age=70, pension=300>:each_pair>', os.each_pair.inspect
assert_equal [[:name, "John Smith"], [:age, 70], [:pension, 300]], os.each_pair.to_a
+ assert_equal 3, os.each_pair.size
end
def test_eql_and_hash