Skip to content

Instantly share code, notes, and snippets.

@jeffmccune
Created September 6, 2012 23:30
Show Gist options
  • Save jeffmccune/3661339 to your computer and use it in GitHub Desktop.
Save jeffmccune/3661339 to your computer and use it in GitHub Desktop.
tests for kick deprecation
diff --git a/lib/puppet/application/kick.rb b/lib/puppet/application/kick.rb
index f0edbcf..f14ccac 100644
--- a/lib/puppet/application/kick.rb
+++ b/lib/puppet/application/kick.rb
@@ -300,7 +300,7 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
def setup
super()
raise Puppet::Error.new("Puppet kick is not supported on Microsoft Windows") if Puppet.features.microsoft_windows?
- Puppet.deprecation_warning "Puppet kick is deprecated. See http://tbd"
+ # Puppet.deprecation_warning "Puppet kick is deprecated. See http://tbd"
if options[:debug]
Puppet::Util::Log.level = :debug
diff --git a/spec/unit/application/kick_spec.rb b/spec/unit/application/kick_spec.rb
index cd1d950..51e1a4e 100755
--- a/spec/unit/application/kick_spec.rb
+++ b/spec/unit/application/kick_spec.rb
@@ -121,6 +121,12 @@ describe Puppet::Application::Kick, :if => Puppet.features.posix? do
@kick.options.stubs(:[]).with(any_parameters)
end
+ it "should issue a warning that kick is deprecated" do
+ Puppet.expects(:deprecation_warning).with() { |msg| msg =~ /kick is deprecated/ }
+ @kick.setup
+ end
+
+
it "should abort stating that kick is not supported on Windows" do
Puppet.features.stubs(:microsoft_windows?).returns(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment