adding a test for deprecating the milestone method

Fixes #2331
This commit is contained in:
Pier-Hugues Pellerin 2015-01-08 13:12:47 -05:00 committed by Jordan Sissel
parent ecb568e740
commit 49f03efc19
2 changed files with 11 additions and 1 deletions

View file

@ -133,7 +133,7 @@ module LogStash::Config::Mixin
# inside the gemspec.
def milestone(m=nil)
@logger = Cabin::Channel.get(LogStash)
@logger.error(I18n.t('logstash.plugin.deprecated'))
@logger.error(I18n.t('logstash.plugin.deprecated_milestone', :plugin => config_name))
end
# Define a new configuration setting

View file

@ -84,5 +84,15 @@ describe LogStash::Plugin do
LogStash::Filters::Stromae.validate({})
LogStash::Filters::Stromae.validate({})
end
it 'logs an error if the plugin use the milestone option' do
expect_any_instance_of(Cabin::Channel).to receive(:error)
.with(/stromae plugin is using the 'milestone' method/)
class LogStash::Filters::Stromae < LogStash::Filters::Base
config_name "stromae"
milestone 2
end
end
end
end