spec/unit/berkshelf/validator_spec.rb in berkshelf-6.2.2 vs spec/unit/berkshelf/validator_spec.rb in berkshelf-6.3.0
- old
+ new
@@ -2,9 +2,13 @@
describe Berkshelf::Validator do
describe "#validate_files" do
let(:cookbook) { double("cookbook", cookbook_name: "cookbook", path: "path") }
+ before do
+ allow(Dir).to receive(:chdir) { |&block| block.call }
+ end
+
it "raises an error when the cookbook has spaces in the files" do
allow(Dir).to receive(:glob).and_return(["/there are/spaces/in this/recipes/default.rb"])
expect do
subject.validate_files(cookbook)
end.to raise_error(Berkshelf::InvalidCookbookFiles)