Module: AktionTest::Matchers::FileSystem::DirectoryContains

Defined in:
lib/aktion_test/matchers/file_system/directory_contains.rb

Defined Under Namespace

Classes: Matcher

Instance Method Summary collapse

Instance Method Details

#have_file(path) ⇒ Object



5
6
7
8
9
10
# File 'lib/aktion_test/matchers/file_system/directory_contains.rb', line 5

def have_file(path)
  segments = path.split('/')
  file = segments.pop
  tree = segments.reverse.reduce([file]) {|a,b| [{b => a}] }
  have_tree(tree)
end

#have_tree(tree) ⇒ Object



12
13
14
# File 'lib/aktion_test/matchers/file_system/directory_contains.rb', line 12

def have_tree(tree)
  Matcher.new(tree)
end