Michael Stillwell 7941748db7 Return exit status of 1 on invalid command
Makes "vagrant destroyjj" and similar return an exit code of 1, so that
"vagrant destroyjj && vagrant up" works as expected.
2013-01-27 19:52:43 +00:00

32 lines
720 B
Ruby

describe Vagrant::CLI do
describe "parsing options" do
let(:klass) do
Class.new(described_class)
end
let(:environment) do
ui = double("UI::Silent")
ui.stub(:info => "bar")
env = double("Vagrant::Environment")
env.stub(:ui => ui)
env.stub(:root_path => "foo")
env.stub(:machine_names => [])
env
end
it "returns a non-zero exit status if an invalid command is given" do
result = klass.new(["destroypp"], environment).execute
result.should_not == 0
end
it "returns an exit status of zero if a valid command is given" do
result = klass.new(["destroy"], environment).execute
result.should == 0
end
end
end