diff options
| author | mo khan <mo@mokhan.ca> | 2015-05-01 21:43:02 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-05-01 21:43:02 -0600 |
| commit | 685ad1b0014a15718d7cd96067001c6f8e6b8a55 (patch) | |
| tree | 5d1a9e58ced7cf09b2df509c91f33ab5bb87a479 /spec | |
| parent | e7dc6bce376eefd56fed4ebc4d90b5d2114cd1c3 (diff) | |
start to work on nginx recipe.
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/nginx_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/nginx_spec.rb b/spec/nginx_spec.rb new file mode 100644 index 0000000..bb22d82 --- /dev/null +++ b/spec/nginx_spec.rb @@ -0,0 +1,33 @@ +describe 'mokhan-myface::nginx' do + let(:chef_run) do + ChefSpec::SoloRunner.new do |node| + node.set['nginx']['domain'] = 'www.example.com' + end.converge(described_recipe) + end + + it 'installs nginx' do + expect(chef_run).to install_package("nginx") + end + + it 'creates a directory for the ssl certificates' do + expect(chef_run).to create_directory('/etc/nginx/ssl') + .with_owner('root') + .with_group('root') + .with_mode('0644') + end + + it 'copies the ssl certificate' do + expect(chef_run).to create_cookbook_file("/etc/nginx/ssl/www.example.com.crt") + .with_mode("0644") + end + + it 'copies the ssl private key' do + expect(chef_run).to create_cookbook_file("/etc/nginx/ssl/www.example.com.key") + .with_mode("0644") + end + + it 'copies over the blacklist file' do + expect(chef_run).to create_cookbook_file("/etc/nginx/conf.d/blacklist.conf") + .with_mode("0644") + end +end |
