summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-05-23 22:37:48 -0600
committermo khan <mo@mokhan.ca>2015-05-23 22:37:48 -0600
commit4107ff25f6803af74d69da116e5ea58ae09a4e67 (patch)
tree4cc337d1f75447fba48f1f1547a0e8ec06a12584 /spec
parent5e5f43661603dcae93e8b3a4a04bd4786b9a6594 (diff)
fix broken capistrano specs.
Diffstat (limited to 'spec')
-rw-r--r--spec/capistrano_spec.rb33
1 files changed, 19 insertions, 14 deletions
diff --git a/spec/capistrano_spec.rb b/spec/capistrano_spec.rb
index 48a64a1..65971f7 100644
--- a/spec/capistrano_spec.rb
+++ b/spec/capistrano_spec.rb
@@ -1,40 +1,45 @@
-describe 'mokhan-myface::capistrano' do
+describe "mokhan-myface::capistrano" do
subject do
ChefSpec::SoloRunner.new do |node|
- node.set['capistrano']['root_path'] = root_path
- node.set['capistrano']['username'] = username
- node.set['postgres']['database'] = 'app'
- node.set['postgres']['username'] = username
- node.set['postgres']['password'] = 'password'
- node.set['postgres']['host'] = 'localhost'
+ node.set["capistrano"]["root_path"] = root_path
+ node.set["capistrano"]["username"] = username
+ node.set["postgres"]["database"] = "app"
+ node.set["postgres"]["username"] = username
+ node.set["postgres"]["password"] = "password"
+ node.set["postgres"]["host"] = "localhost"
end.converge(described_recipe)
end
let(:root_path) { "/var/www/#{FFaker::Internet.domain_name}" }
let(:shared_path) { "#{root_path}/shared" }
- let(:username) { 'deployer' }
+ let(:username) { "deployer" }
- it 'creates the root directory for the application' do
+ before :each do
+ stub_command("stat -c %U #{root_path} | grep root").and_return(nil)
+ end
+
+ it "creates the root directory for the application" do
expect(subject).to create_directory(root_path)
.with_owner(username)
.with_group(username)
.with_mode("0755")
end
- it 'creates the shared directory for the application' do
+ it "creates the shared directory for the application" do
expect(subject).to create_directory("#{root_path}/shared")
.with_owner(username)
.with_group(username)
.with_mode("0755")
end
- it 'creates all the shared folders' do
+ it "creates all the shared folders" do
directories = [
"#{shared_path}/backups",
"#{shared_path}/bundle",
"#{shared_path}/config",
"#{shared_path}/log",
- "#{shared_path}/pids",
- "#{shared_path}/sockets",
+ "#{shared_path}/tmp/sockets",
+ "#{shared_path}/tmp/pids",
+ "#{shared_path}/tmp/cache",
"#{root_path}/releases"
]
directories.each do |directory|
@@ -45,7 +50,7 @@ describe 'mokhan-myface::capistrano' do
end
end
- it 'lays down the .env template' do
+ it "lays down the .env template" do
expect(subject).to create_template("#{shared_path}/.env._default")
.with_owner(username)
.with_group(username)