summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-05-23 17:58:54 -0600
committermo khan <mo@mokhan.ca>2015-05-23 17:58:54 -0600
commit7ef5d801e7f9c70c11f2901d9bbb162310a5a2a1 (patch)
tree29ece37154317d3ded52e78b8582cd33be69f822 /spec
parent8412560778aa73d63340c76e5aa4e9cf0e0aca7b (diff)
split the unicorn recipe from the puma one.
Diffstat (limited to 'spec')
-rw-r--r--spec/puma_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/puma_spec.rb b/spec/puma_spec.rb
new file mode 100644
index 0000000..c711e2c
--- /dev/null
+++ b/spec/puma_spec.rb
@@ -0,0 +1,37 @@
+describe "mokhan-myface::puma" do
+ subject do
+ ChefSpec::SoloRunner.new do |node|
+ node.set['puma'] = configuration
+ end.converge(described_recipe)
+ end
+
+ let(:username) { FFaker::Internet.user_name }
+ let(:configuration) do
+ {
+ username: username,
+ current_path: '/tmp',
+ }
+ end
+
+ it 'creates the puma init.d script' do
+ expect(subject).to create_template("/etc/init.d/puma")
+ .with_source("puma.erb")
+ .with_owner(username)
+ .with_group(username)
+ .with_mode("0744")
+ end
+
+ 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 puma service' do
+ expect(subject).to start_service("puma")
+ end
+ end
+end