test/deprecated_command_test.rb in knife-solo-0.3.0.pre3 vs test/deprecated_command_test.rb in knife-solo-0.3.0.pre4

- old
+ new

@@ -4,10 +4,14 @@ require 'knife-solo/deprecated_command' class DummyNewCommand < Chef::Knife banner "knife dummy_new_command" + option :foo, + :long => '--foo', + :description => 'Foo option' + def run # calls #new_run so we can be sure this gets called new_run end @@ -30,14 +34,23 @@ cmd = command cmd.ui.expects(:err).with(regexp_matches(/deprecated!/)) cmd.run end - def test_runs_original_command + def test_runs_new_command cmd = command cmd.ui.stubs(:err) cmd.expects(:new_run) cmd.run + end + + def test_includes_options_from_new_command + assert DummyDeprecatedCommand.options.include?(:foo) + end + + def test_loads_dependencies_from_new_command + DummyNewCommand.expects(:load_deps) + DummyDeprecatedCommand.load_deps end def command(*args) DummyDeprecatedCommand.load_deps DummyDeprecatedCommand.new(args)