mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@6f38a82
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b864bd05bf
commit
4fbb9aa3cb
145 changed files with 2847 additions and 2596 deletions
|
@ -62,34 +62,11 @@ describe "Enumerable#chunk" do
|
|||
lambda { e.chunk { |x| :_arbitrary }.to_a }.should raise_error(RuntimeError)
|
||||
end
|
||||
|
||||
ruby_version_is ""..."2.3" do
|
||||
describe "with [initial_state]" do
|
||||
it "yields an element and an object value-equal but not identical to the object passed to #chunk" do
|
||||
e = EnumerableSpecs::Numerous.new(1)
|
||||
value = "value"
|
||||
|
||||
e.chunk(value) do |x, v|
|
||||
x.should == 1
|
||||
v.should == value
|
||||
v.should_not equal(value)
|
||||
end.to_a
|
||||
end
|
||||
|
||||
it "does not yield the object passed to #chunk if it is nil" do
|
||||
e = EnumerableSpecs::Numerous.new(1)
|
||||
e.chunk(nil) { |*x| ScratchPad << x }.to_a
|
||||
ScratchPad.recorded.should == [[1]]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is "2.3" do
|
||||
it "does not accept arguments" do
|
||||
e = EnumerableSpecs::Numerous.new(1, 2, 3)
|
||||
lambda {
|
||||
e.chunk(1) {}
|
||||
}.should raise_error(ArgumentError)
|
||||
end
|
||||
it "does not accept arguments" do
|
||||
e = EnumerableSpecs::Numerous.new(1, 2, 3)
|
||||
lambda {
|
||||
e.chunk(1) {}
|
||||
}.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it 'returned Enumerator size returns nil' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue