mirror of
https://github.com/meineerde/rackstash.git
synced 2026-03-10 11:03:05 +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
|
end
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
alias prepend unshift
|
||||||
|
|
||||||
# Returns an Array representation of the filter chain.
|
# Returns an Array representation of the filter chain.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -455,6 +455,11 @@ describe Rackstash::FilterChain do
|
|||||||
|
|
||||||
expect { filter_chain.unshift }.to raise_error ArgumentError
|
expect { filter_chain.unshift }.to raise_error ArgumentError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'can use #prepend alias' do
|
||||||
|
filter_chain.prepend filter
|
||||||
|
expect(filter_chain[0]).to eql filter
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#to_a' do
|
describe '#to_a' do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user