spec/support/matchers/file_system_matchers.rb in berkshelf-1.2.1 vs spec/support/matchers/file_system_matchers.rb in berkshelf-1.3.0.rc1

- old
+ new

@@ -1,11 +1,11 @@ # Taken from (https://github.com/carlhuda/beard) # Permission granted by Yehuda Katz (Jan 4th, 2012) module Berkshelf module RSpec module FileSystemMatchers - class File + class File < ::File def initialize(name, &block) @contents = [] @negative_contents = [] @name = name @@ -56,10 +56,12 @@ def directory(name, &block) @tree[name] = block_given? && Directory.new(location(name), &block) end def file(name, &block) - @tree[name] = File.new(location(name), &block) + silence_warnings do + @tree[name] = Berkshelf::RSpec::FileSystemMatchers::File.new(location(name), &block) + end end def no_file(name) @negative_tree << name end