1
0
mirror of https://github.com/meineerde/rackstash.git synced 2026-01-31 17:27:13 +00:00

Provide prepend alias for FilterChain@unshift

Ruby 2.5 introduces this alias for all arrays.
This commit is contained in:
Holger Just 2017-12-20 21:28:12 +01:00
parent 43a303b09d
commit 6bfe8ecb25
2 changed files with 6 additions and 0 deletions

View File

@ -251,6 +251,7 @@ module Rackstash
end
self
end
alias prepend unshift
# Returns an Array representation of the filter chain.
#

View File

@ -455,6 +455,11 @@ describe Rackstash::FilterChain do
expect { filter_chain.unshift }.to raise_error ArgumentError
end
it 'can use #prepend alias' do
filter_chain.prepend filter
expect(filter_chain[0]).to eql filter
end
end
describe '#to_a' do