Skip to content

Commit

Permalink
Specify new behavior for Enumerable{chunk,slice_before}
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jan 3, 2016
1 parent 5885e2b commit 8b118fd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/enumerable/chunk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@
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
end

it 'returned Enumerator size returns nil' do
e = EnumerableSpecs::NumerousWithSize.new(1, 2, 3, 2, 1)
enum = e.chunk { |x| true }
Expand Down
8 changes: 8 additions & 0 deletions core/enumerable/slice_before_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
end
end
end

ruby_version_is "2.3" do
it "does not accept arguments" do
lambda {
@enum.slice_before(1) {}
}.should raise_error(ArgumentError)
end
end
end

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

0 comments on commit 8b118fd

Please sign in to comment.