spec/shelly/cli/main_spec.rb in shelly-0.4.34 vs spec/shelly/cli/main_spec.rb in shelly-0.4.35
- old
+ new
@@ -44,10 +44,11 @@
out.should include("shelly info # Show basic information about cloud")
out.should include("shelly list # List available clouds")
out.should include("shelly login [EMAIL] # Log into Shelly Cloud")
out.should include("shelly logout # Logout from Shelly Cloud")
out.should include("shelly logs <command> # View application logs")
+ out.should include("shelly maintenance <command> # Mange application maintenance events")
out.should include("shelly mongoconsole # Run MongoDB console")
out.should include("shelly open # Open application page in browser")
out.should include("shelly organization <command> # View organizations")
out.should include("shelly rake TASK # Run rake task")
out.should include("shelly redeploy # Redeploy application")
@@ -1013,9 +1014,38 @@
$stdout.should_receive(:puts).with(" Traffic:")
$stdout.should_receive(:puts).with(" Incoming: 11.54 GiB")
$stdout.should_receive(:puts).with(" Outgoing: 1.15 GiB")
$stdout.should_receive(:puts).with(" Total: 12.69 GiB")
invoke(@main, :info)
+ end
+
+ context "when usage and traffic is not present" do
+ before do
+ @app.stub(:attributes).and_return(response({
+ "billing" => {
+ "current_month_costs" => {
+ "usage" => [],
+ "traffic" => {
+ "incoming" => nil,
+ "outgoing" => nil,
+ "total" => nil
+ }
+ }
+ },
+ }))
+ end
+
+ it "should print 0.0 B usage" do
+ @main.should_receive(:multiple_clouds).and_return(@app)
+ $stdout.should_receive(:puts).with(" Usage:")
+ $stdout.should_not_receive(:puts).with(" Filesystem:")
+ $stdout.should_not_receive(:puts).with(" Database:")
+ $stdout.should_receive(:puts).with(" Traffic:")
+ $stdout.should_receive(:puts).with(" Incoming: 0.0 B")
+ $stdout.should_receive(:puts).with(" Outgoing: 0.0 B")
+ $stdout.should_receive(:puts).with(" Total: 0.0 B")
+ invoke(@main, :info)
+ end
end
context "when deploy failed" do
context "and app is in maintenance" do
it "should display basic information without instruction to show last app logs" do