spec/cany/recipes/sidekiq_spec.rb in cany-0.1.3 vs spec/cany/recipes/sidekiq_spec.rb in cany-0.2.0
- old
+ new
@@ -26,10 +26,11 @@
expect(recipe.inner).to receive(:binary)
recipe.binary
end
end
end
+
context 'with queue names' do
before do
spec.setup do
use :sidekiq do
queue :name1
@@ -42,9 +43,31 @@
expect(recipe).to receive(:install_service).with(
:sidekiq,
%w(/usr/bin/test sidekiq --environment production --queue name1,name2),
user: 'www-data', group: 'www-data'
)
+ recipe.inner = double('recipe')
+ expect(recipe.inner).to receive(:binary)
+ recipe.binary
+ end
+ end
+
+ context 'with defined user/group' do
+ before do
+ spec.setup do
+ use :sidekiq do
+ user 'user'
+ group 'group'
+ end
+ end
+ end
+
+ it 'should launch sidekiq with as this user and group' do
+ expect(recipe).to receive(:install_service).with(
+ :sidekiq,
+ %w(/usr/bin/test sidekiq --environment production),
+ user: 'user', group: 'group'
+ )
recipe.inner = double('recipe')
expect(recipe.inner).to receive(:binary)
recipe.binary
end
end