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:
parent
43a303b09d
commit
6bfe8ecb25
@ -251,6 +251,7 @@ module Rackstash
|
||||
end
|
||||
self
|
||||
end
|
||||
alias prepend unshift
|
||||
|
||||
# Returns an Array representation of the filter chain.
|
||||
#
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user