spec/kitchen/provisioner/chef_solo_spec.rb in test-kitchen-1.10.2 vs spec/kitchen/provisioner/chef_solo_spec.rb in test-kitchen-1.11.0

- old
+ new

@@ -399,20 +399,30 @@ it "sets log level flag on chef-solo to auto by default" do cmd.must_match regexify(" --log_level auto", :partial_line) end + it "sets log level flag on chef-solo to info by default if running Chef < 11" do + config[:require_chef_omnibus] = "10.34.6" + cmd.must_match regexify(" --log_level info", :partial_line) + end + it "set log level flag for custom level" do config[:log_level] = :extreme cmd.must_match regexify(" --log_level extreme", :partial_line) end it "sets force formatter flag on chef-solo" do cmd.must_match regexify(" --force-formatter", :partial_line) end + it "does not set force formatter flag on chef-solo if running Chef < 11" do + config[:require_chef_omnibus] = "10.34.6" + cmd.wont_match regexify(" --force-formatter", :partial_line) + end + it "sets no color flag on chef-solo" do cmd.must_match regexify(" --no-color", :partial_line) end it "does not set logfile flag by default" do @@ -434,9 +444,21 @@ it "does not set profile-ruby flag when config element is falsey" do config[:profile_ruby] = false cmd.wont_match regexify(" --profile-ruby", :partial_line) + end + + it "sets legacy-mode flag when config element is set" do + config[:legacy_mode] = true + + cmd.must_match regexify(" --legacy-mode", :partial_line) + end + + it "does not set legacy-mode flag when config element is falsey" do + config[:legacy_mode] = false + + cmd.wont_match regexify(" --legacy-mode", :partial_line) end end describe "for powershell shells on windows os types" do