summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-05-02 22:51:03 -0600
committermo khan <mo@mokhan.ca>2015-05-02 22:51:03 -0600
commit2eacf29ca2b13178a7a7ab61a75ac9ad59b03568 (patch)
treee854a99bede1290adda131605f168d3d70e4b555 /spec
parent60d5f4bdeb4b44c7b01dca7bfaf2c76bace17b95 (diff)
test out unicorn recipe with test-kitchen.
Diffstat (limited to 'spec')
-rw-r--r--spec/unicorn_spec.rb22
1 files changed, 16 insertions, 6 deletions
diff --git a/spec/unicorn_spec.rb b/spec/unicorn_spec.rb
index a68e10b..dde05c6 100644
--- a/spec/unicorn_spec.rb
+++ b/spec/unicorn_spec.rb
@@ -1,14 +1,15 @@
describe "mokhan-myface::unicorn" do
subject do
ChefSpec::SoloRunner.new do |node|
- node.set['unicorn'] = unicorn_variables
+ node.set['unicorn'] = configuration
end.converge(described_recipe)
end
let(:username) { FFaker::Internet.user_name }
- let(:unicorn_variables) do
+ let(:configuration) do
{
- 'username' => username
+ username: username,
+ current_path: '/tmp',
}
end
@@ -18,10 +19,19 @@ describe "mokhan-myface::unicorn" do
.with_owner(username)
.with_group(username)
.with_mode("0744")
- .with_variables(unicorn_variables)
end
- it 'starts the unicorn service' do
- expect(subject).to start_service("unicorn")
+ context "when the app is deployed" do
+ before :each do
+ FileUtils.touch('/tmp/Gemfile')
+ end
+
+ after :each do
+ FileUtils.rm('/tmp/Gemfile')
+ end
+
+ it 'starts the unicorn service' do
+ expect(subject).to start_service("unicorn")
+ end
end
end