summaryrefslogtreecommitdiff
path: root/spec/functional/resource
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-11-08 14:06:33 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2019-11-08 14:06:33 -0800
commit8a7e29d52882c39d0c903eef83bd3472e4f334af (patch)
treea25a7b76416e07ebdb54e569fb0006079cf012db /spec/functional/resource
parentc31625406530b560fab02b11fa2447955ed2faef (diff)
downloadchef-8a7e29d52882c39d0c903eef83bd3472e4f334af.tar.gz
Add chef-utils gem with various recipe DSL helpers
This is the implementation of [RFC-087](https://github.com/chef-boneyard/chef-rfc/blob/master/rfc087-distro-sugar-helpers.md) although some of the specifics have been iterated on and changed. The documentation will be in the [README.md](https://github.com/chef/chef/tree/master/chef-utils/README.md) once this is merged. While this PR mostly moves chef-sugar utilities into core-chef via this chef-utils gem, the scope of the chef-utils gem should be considered larger than just that. As an example this PR moves the Mash class into this gem for reuse in ohai as well. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional/resource')
-rw-r--r--spec/functional/resource/cookbook_file_spec.rb4
-rw-r--r--spec/functional/resource/template_spec.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/functional/resource/cookbook_file_spec.rb b/spec/functional/resource/cookbook_file_spec.rb
index 6e964a6499..37d31188ac 100644
--- a/spec/functional/resource/cookbook_file_spec.rb
+++ b/spec/functional/resource/cookbook_file_spec.rb
@@ -68,11 +68,11 @@ describe Chef::Resource::CookbookFile do
let(:path) { File.join(windows_non_temp_dir, make_tmpname(file_base)) }
before do
- FileUtils.mkdir_p(windows_non_temp_dir) if Chef::Platform.windows?
+ FileUtils.mkdir_p(windows_non_temp_dir) if ChefUtils.windows?
end
after do
- FileUtils.rm_r(windows_non_temp_dir) if Chef::Platform.windows? && File.exists?(windows_non_temp_dir)
+ FileUtils.rm_r(windows_non_temp_dir) if ChefUtils.windows? && File.exists?(windows_non_temp_dir)
end
end
diff --git a/spec/functional/resource/template_spec.rb b/spec/functional/resource/template_spec.rb
index feef97dd27..63a950db95 100644
--- a/spec/functional/resource/template_spec.rb
+++ b/spec/functional/resource/template_spec.rb
@@ -203,7 +203,7 @@ describe Chef::Resource::Template do
it "output should contain platform's line endings" do
resource.run_action(:create)
binread(path).each_line do |line|
- expect(line).to end_with(Chef::Platform.windows? ? "\r\n" : "\n")
+ expect(line).to end_with(ChefUtils.windows? ? "\r\n" : "\n")
end
end
end