File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed
Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 2929before_script :
3030 - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
3131 - eval "$(/opt/chefdk/bin/chef shell-init bash)"
32+ - /opt/chefdk/embedded/bin/chef --version
33+ - /opt/chefdk/embedded/bin/cookstyle --version
34+ - /opt/chefdk/embedded/bin/foodcritic --version
3235 - /opt/chefdk/embedded/bin/chef gem install coveralls # needed for chefspecs
3336
3437script : KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}
3538
3639matrix :
3740 include :
38- - before_script :
39- - eval "$(/opt/chefdk/bin/chef shell-init bash)"
40- - /opt/chefdk/embedded/bin/chef --version
41- - /opt/chefdk/embedded/bin/cookstyle --version
42- - /opt/chefdk/embedded/bin/foodcritic --version
4341 - script :
4442 - /opt/chefdk/bin/chef exec rake
4543 env : UNIT_AND_LINT=1
Original file line number Diff line number Diff line change 1515# limitations under the License.
1616#
1717
18- require_relative '../ spec_helper'
18+ require ' spec_helper'
1919
2020describe 'nginx-hardening::default' do
21- before { allow_any_instance_of ( Chef ::Recipe ) . to receive ( :search ) }
2221 let ( :runner ) { ChefSpec ::ServerRunner . new ( platform : 'ubuntu' , version : '16.04' ) }
23- let ( :node ) { runner . node }
2422 let ( :chef_run ) { runner . converge ( 'chef_nginx::default' , described_recipe ) }
2523
26- before do
27- stub_command ( '/usr/sbin/apache2 -t' )
24+ before ( :each ) do
2825 stub_command ( "find /etc/nginx -perm -o+r -type f -o -perm -o+w -type f | wc -l | egrep '^0$'" )
29- stub_command ( 'which nginx' ) . and_return ( true )
30- allow ( ::File ) . to receive ( :exist? ) . and_return ( false )
31- allow ( ::File ) . to receive ( :exist? ) . with ( '/etc/nginx/dh2048.pem' ) . and_return ( false )
3226 end
3327
34- # check that the recipres are executed
28+ # check that the recipes are executed
3529 it 'default should include os-hardening recipes by default' do
3630 expect ( chef_run ) . to include_recipe 'nginx-hardening::minimize_access'
3731 end
Original file line number Diff line number Diff line change 2020require 'chefspec/berkshelf'
2121require 'coveralls'
2222
23+ RSpec . configure do |config |
24+ config . color = true # Use color in STDOUT
25+ config . formatter = :documentation # Use the specified formatter
26+ config . log_level = :error # Avoid deprecation notice SPAM
27+ end
28+
2329# coverage report
2430Coveralls . wear!
2531at_exit { ChefSpec ::Coverage . report! }
You can’t perform that action at this time.
0 commit comments