require 'spec_helper' describe Cany::Dpkg::DebHelperRecipe do let!(:dir) { Dir.mktmpdir } before do Dir.mkdir File.join(dir, 'debian') @old_path = Dir.pwd Dir.chdir(dir) end after do Dir.chdir @old_path FileUtils.remove_entry dir end let(:spec) do s = Cany::Specification.new do name 'test' description 'Your RSpec Upstart-Scripts' end s.base_dir = dir s end let(:recipe) { described_class.new spec } subject { recipe } describe '#binary' do it 'should install services' do should receive(:install_services) subject.binary end it 'should install base service' do should receive(:install_base_service) subject.binary end end describe '#install_services' do before do recipe.install_service :service, %w(hans args1), user: 'www-data', group: 'www-data' recipe.install_services end subject { File.read File.join(dir, 'debian', 'test.test-service.upstart') } it 'should create files' do should eq <