1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2019-02-07 16:35:33 +00:00
parent 5c7c6763f6
commit 75334db3c6
111 changed files with 1031 additions and 231 deletions

View file

@ -21,16 +21,16 @@ describe "Enumerable#zip" do
end
it "converts arguments to arrays using #to_ary" do
convertable = EnumerableSpecs::ArrayConvertable.new(4,5,6)
EnumerableSpecs::Numerous.new(1,2,3).zip(convertable).should == [[1,4],[2,5],[3,6]]
convertable.called.should == :to_ary
convertible = EnumerableSpecs::ArrayConvertible.new(4,5,6)
EnumerableSpecs::Numerous.new(1,2,3).zip(convertible).should == [[1,4],[2,5],[3,6]]
convertible.called.should == :to_ary
end
it "converts arguments to enums using #to_enum" do
convertable = EnumerableSpecs::EnumConvertable.new(4..6)
EnumerableSpecs::Numerous.new(1,2,3).zip(convertable).should == [[1,4],[2,5],[3,6]]
convertable.called.should == :to_enum
convertable.sym.should == :each
convertible = EnumerableSpecs::EnumConvertible.new(4..6)
EnumerableSpecs::Numerous.new(1,2,3).zip(convertible).should == [[1,4],[2,5],[3,6]]
convertible.called.should == :to_enum
convertible.sym.should == :each
end
it "gathers whole arrays as elements when each yields multiple" do