summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-01-07 14:18:44 -0800
committerJohn Keiser <john@johnkeiser.com>2016-01-13 09:23:07 -0800
commit6d9c8b03466632b3cd11042a2b99a08ae5047309 (patch)
tree0bbff68a54b99e7f6f70819783a75bc9967093d1 /spec/support
parent5e5cbe6df61ae69b9a5942ce51a7ad1f8bb6ea3a (diff)
downloadchef-6d9c8b03466632b3cd11042a2b99a08ae5047309.tar.gz
Move server and repository fs objects to their own directories
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared/unit/file_system_support.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/support/shared/unit/file_system_support.rb b/spec/support/shared/unit/file_system_support.rb
index 3f9e6df3b9..3aee46fc7f 100644
--- a/spec/support/shared/unit/file_system_support.rb
+++ b/spec/support/shared/unit/file_system_support.rb
@@ -17,16 +17,16 @@
#
require 'chef/chef_fs/file_system'
-require 'chef/chef_fs/file_system/memory_root'
-require 'chef/chef_fs/file_system/memory_dir'
-require 'chef/chef_fs/file_system/memory_file'
+require 'chef/chef_fs/file_system/memory/memory_root'
+require 'chef/chef_fs/file_system/memory/memory_dir'
+require 'chef/chef_fs/file_system/memory/memory_file'
module FileSystemSupport
def memory_fs(pretty_name, value, cannot_be_in_regex = nil)
if !value.is_a?(Hash)
raise "memory_fs() must take a Hash"
end
- dir = Chef::ChefFS::FileSystem::MemoryRoot.new(pretty_name, cannot_be_in_regex)
+ dir = Chef::ChefFS::FileSystem::Memory::MemoryRoot.new(pretty_name, cannot_be_in_regex)
value.each do |key, child|
dir.add_child(memory_fs_value(child, key.to_s, dir))
end
@@ -35,13 +35,13 @@ module FileSystemSupport
def memory_fs_value(value, name = '', parent = nil)
if value.is_a?(Hash)
- dir = Chef::ChefFS::FileSystem::MemoryDir.new(name, parent)
+ dir = Chef::ChefFS::FileSystem::Memory::MemoryDir.new(name, parent)
value.each do |key, child|
dir.add_child(memory_fs_value(child, key.to_s, dir))
end
dir
else
- Chef::ChefFS::FileSystem::MemoryFile.new(name, parent, value || "#{name}\n")
+ Chef::ChefFS::FileSystem::Memory::MemoryFile.new(name, parent, value || "#{name}\n")
end
end
@@ -54,7 +54,7 @@ module FileSystemSupport
end
def no_blocking_calls_allowed
- [ Chef::ChefFS::FileSystem::MemoryFile, Chef::ChefFS::FileSystem::MemoryDir ].each do |c|
+ [ Chef::ChefFS::FileSystem::Memory::MemoryFile, Chef::ChefFS::FileSystem::Memory::MemoryDir ].each do |c|
[ :children, :exists?, :read ].each do |m|
allow_any_instance_of(c).to receive(m).and_raise("#{m} should not be called")
end
@@ -67,4 +67,3 @@ module FileSystemSupport
expect(result_paths).to match_array(expected_paths)
end
end
-