require 'spec_helper' describe Cany::Recipes::Thin do let(:setup) { proc { use :thin } } let(:spec) do Cany::Specification.new do name 'test' end end let(:recipe) { spec.recipes.first } let(:system_recipe) { Cany::Dpkg::DebHelperRecipe.new(spec) } let(:pre_scripts) { system_recipe.option(:service_pre_scripts) } subject { recipe.binary } context '#binary' do before do spec.setup &setup spec.system_recipe = system_recipe recipe.inner = double('recipe') expect(recipe.inner).to receive(:binary) end context 'without configuration' do it 'should launch unicorn only with environment specification and config file' do expect(recipe).to receive(:install_service).with( :thin, %w(/usr/bin/test thin start --config /etc/test/thin.yml), user: 'www-data', group: 'www-data' ) expect(recipe).to receive(:install_content).with '/etc/test/thin.yml', <