diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-12-08 13:44:59 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-12-08 13:45:29 -0800 |
commit | 1b3705ca383b64092c9ef54d7e46201fab6271c7 (patch) | |
tree | e14588c68939b80e9cd8c5bf0b0eab4bfddbc96c /spec/unit/cookbook/syntax_check_spec.rb | |
parent | 2bdc79409711e836a7698f7b44d171fa7973d4f1 (diff) | |
download | chef-1b3705ca383b64092c9ef54d7e46201fab6271c7.tar.gz |
Execute and Script Resource improvements
- Warning on incorrect usage of the command resource in any script
resource
- Warning on code in script resource being nil
- Specs added to force deprecation of incorrect usage in Chef-13
- Specs added around the (supported) incorrect usage in Chef-12
- Cleanup+Modernization of providers and specs
- Fixed some global state bugs around the Chef::Log.level in the spec
tests
Diffstat (limited to 'spec/unit/cookbook/syntax_check_spec.rb')
-rw-r--r-- | spec/unit/cookbook/syntax_check_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/cookbook/syntax_check_spec.rb b/spec/unit/cookbook/syntax_check_spec.rb index 67d31cdca5..471fc01831 100644 --- a/spec/unit/cookbook/syntax_check_spec.rb +++ b/spec/unit/cookbook/syntax_check_spec.rb @@ -43,6 +43,7 @@ describe Chef::Cookbook::SyntaxCheck do before do Chef::Log.logger = Logger.new(StringIO.new) + @original_log_level = Chef::Log.level Chef::Log.level = :warn # suppress "Syntax OK" messages @attr_files = %w{default.rb smokey.rb}.map { |f| File.join(cookbook_path, 'attributes', f) } @@ -61,6 +62,10 @@ describe Chef::Cookbook::SyntaxCheck do @template_files = basenames.map { |f| File.join(cookbook_path, 'templates', 'default', f)} end + after do + Chef::Log.level = @original_log_level + end + it "creates a syntax checker given the cookbook name when Chef::Config.cookbook_path is set" do Chef::Config[:cookbook_path] = File.dirname(cookbook_path) syntax_check = Chef::Cookbook::SyntaxCheck.for_cookbook(:openldap) |