spec/recipes/sync_spec.rb in o2h-0.1.12 vs spec/recipes/sync_spec.rb in o2h-0.1.13
- old
+ new
@@ -1,9 +1,8 @@
require 'spec_helper'
describe "sync" do
- before { subject.load 'deploy' }
include_context :capistrano
context 'db task' do
let(:application) { "app" }
@@ -28,7 +27,21 @@
subject.should_receive(:run_locally).with("gunzip --stdout tmp/app-dump.sql.gz | psql -p local-port local-db")
subject.execute_task(task)
subject.should have_run("mkdir -p '/shared/app/backup'")
subject.should have_run("pg_dump -c -Z 9 --no-owner -p #{port} -h #{host} -U #{username} -f /shared/app/backup/app-dump.sql.gz #{database}")
end
+
+ it "should call proper subtasks" do
+ namespace.should_receive(:dump)
+ namespace.should_receive(:fetch)
+ namespace.should_receive(:import)
+
+ subject.execute_task(task)
+ end
+ end
+
+ context 'db:fetch task' do
+ subject { task }
+
+ its(:description) { should match(/fetch/i) }
end
end