Skip to content

Commit 8b118fd

Browse files
committed
Specify new behavior for Enumerable{chunk,slice_before}
1 parent 5885e2b commit 8b118fd

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

core/enumerable/chunk_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@
7272
end
7373
end
7474

75+
ruby_version_is "2.3" do
76+
it "does not accept arguments" do
77+
e = EnumerableSpecs::Numerous.new(1, 2, 3)
78+
lambda {
79+
e.chunk(1) {}
80+
}.should raise_error(ArgumentError)
81+
end
82+
end
83+
7584
it 'returned Enumerator size returns nil' do
7685
e = EnumerableSpecs::NumerousWithSize.new(1, 2, 3, 2, 1)
7786
enum = e.chunk { |x| true }

core/enumerable/slice_before_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@
7171
end
7272
end
7373
end
74+
75+
ruby_version_is "2.3" do
76+
it "does not accept arguments" do
77+
lambda {
78+
@enum.slice_before(1) {}
79+
}.should raise_error(ArgumentError)
80+
end
81+
end
7482
end
7583

7684
it "raises an ArgumentError when given an incorrect number of arguments" do

0 commit comments

Comments
 (0)