summaryrefslogtreecommitdiff
path: root/spec/unit/provider
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-08-28 10:59:20 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-09-02 17:49:33 -0700
commit2528c6707beed1b5cdd8029d77d56eee54eff30d (patch)
tree2193860f2213d57c8a3195e398954a2c54af0dc9 /spec/unit/provider
parentc8ffc28a9f59959e0ef5d315e5ac3091453c26de (diff)
downloadchef-2528c6707beed1b5cdd8029d77d56eee54eff30d.tar.gz
refactor remote_directory provider
- Huge speed and memory perf boost. In the prior code if you were copying 10 dotfiles to a home directory with a million files in it, would slurp all million files into a ruby Set object even if you were not ultimately going to purge the unmanaged files. This code inverts the logic and tracks managed files and then iterates through the filesystem without slurping a list into memory. - Only do file purging logic if purging is set. - Fixes mutation of new_resource.overwrite. - Fixes mutation of new_resource.rights (subtle). - Adds helper delegators to the new_resource properties. - Deprecates (instead of removes) now-unused methods. - Renamed a method (with deprecated alias preserved) for consistency. - Adds YARD for everything. - Changes protected to private because protected is largely useless in ruby. - Removes whyrun_supported? because the superclass sets that.
Diffstat (limited to 'spec/unit/provider')
-rw-r--r--spec/unit/provider/remote_directory_spec.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/spec/unit/provider/remote_directory_spec.rb b/spec/unit/provider/remote_directory_spec.rb
index 99e2fe285c..6426dafd79 100644
--- a/spec/unit/provider/remote_directory_spec.rb
+++ b/spec/unit/provider/remote_directory_spec.rb
@@ -79,7 +79,7 @@ describe Chef::Provider::RemoteDirectory do
end
it "configures access control on intermediate directorys" do
- directory_resource = @provider.send(:resource_for_directory, File.join(Dir.tmpdir, "intermediate_dir"))
+ directory_resource = @provider.send(:directory_resource, File.join(Dir.tmpdir, "intermediate_dir"))
expect(directory_resource.path).to eq(File.join(Dir.tmpdir, "intermediate_dir"))
expect(directory_resource.mode).to eq("0750")
expect(directory_resource.group).to eq("wheel")
@@ -219,4 +219,3 @@ describe Chef::Provider::RemoteDirectory do
end
end
-