spec/shelly/cli/main_spec.rb in shelly-0.2.14 vs spec/shelly/cli/main_spec.rb in shelly-0.2.15

- old
+ new

@@ -1413,13 +1413,25 @@ it "execute ssh command" do @app.should_receive(:console) invoke(@main, :console) end - context "Instances are not running" do + context "virtual servers are not running" do it "should display error" do @client.stub(:console).and_raise(Shelly::Client::ConflictException) $stdout.should_receive(:puts).with(red "Cloud foo-production is not running. Cannot run console.") + lambda { + invoke(@main, :console) + }.should raise_error(SystemExit) + end + end + + context "virtual server not found" do + it "should display error" do + ex = Shelly::Client::NotFoundException.new("resource" => "virtual_server") + @client.stub(:console).and_raise(ex) + @main.options = {:server => "foobar"} + $stdout.should_receive(:puts).with(red "Virtual Server 'foobar' not found") lambda { invoke(@main, :console) }.should raise_error(SystemExit) end end