spec/shelly/cli/backup_spec.rb in shelly-0.2.23 vs spec/shelly/cli/backup_spec.rb in shelly-0.2.24
- old
+ new
@@ -77,10 +77,15 @@
it "should ensure user has logged in" do
hooks(@backup, :get).should include(:logged_in?)
end
+ it "should have a 'download' alias" do
+ @client.should_receive(:download_backup).with("foo-staging", "better.tar.gz", @bar.progress_callback)
+ invoke(@backup, :download, "better.tar.gz")
+ end
+
# multiple_clouds is tested in main_spec.rb in describe "#start" block
it "should ensure multiple_clouds check" do
@client.should_receive(:database_backup).with("foo-staging", "last")
@backup.should_receive(:multiple_clouds).and_return(@app)
invoke(@backup, :get)
@@ -105,11 +110,11 @@
invoke(@backup, :get, "last")
end
context "on backup not found" do
it "it should display error message" do
- exception = Shelly::Client::NotFoundException.new({"resource" => "database_backup"})
+ exception = Shelly::Client::NotFoundException.new({"resource" => "backup"})
@client.stub(:database_backup).and_raise(exception)
$stdout.should_receive(:puts).with(red "Backup not found")
$stdout.should_receive(:puts).with("You can list available backups with `shelly backup list` command")
invoke(@backup, :get, "better.tar.gz")
end
@@ -235,10 +240,10 @@
end
end
context "on backup not found" do
it "should display error message" do
- response = {"resource" => "database_backup"}
+ response = {"resource" => "backup"}
exception = Shelly::Client::NotFoundException.new(response)
@client.stub(:database_backup).and_raise(exception)
$stdout.should_receive(:puts).with(red "Backup not found")
$stdout.should_receive(:puts).with("You can list available backups with `shelly backup list` command")
invoke(@backup, :restore, "better.tar.gz")