aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/enumerable/chain_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/enumerable/chain_spec.rb')
-rw-r--r--spec/ruby/core/enumerable/chain_spec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/ruby/core/enumerable/chain_spec.rb b/spec/ruby/core/enumerable/chain_spec.rb
index 0e86a02905..85c0c03603 100644
--- a/spec/ruby/core/enumerable/chain_spec.rb
+++ b/spec/ruby/core/enumerable/chain_spec.rb
@@ -9,14 +9,17 @@ ruby_version_is "2.6" do
it "returns a chain of self and provided enumerables" do
one = EnumerableSpecs::Numerous.new(1)
- two = EnumerableSpecs::Numerous.new(2)
- three = EnumerableSpecs::Numerous.new(3)
+ two = EnumerableSpecs::Numerous.new(2, 3)
+ three = EnumerableSpecs::Numerous.new(4, 5, 6)
chain = one.chain(two, three)
- chain.should be_an_instance_of(Enumerator::Chain)
chain.each { |item| ScratchPad << item }
- ScratchPad.recorded.should == [1, 2, 3]
+ ScratchPad.recorded.should == [1, 2, 3, 4, 5, 6]
+ end
+
+ it "returns an Enumerator::Chain if given a block" do
+ EnumerableSpecs::Numerous.new.chain.should be_an_instance_of(Enumerator::Chain)
end
end
end