Sha256: 3ae378dd550e0ae405a51b97570baec18b3de02f0080adf746c0245e9ae0da23

Contents?: true

Size: 728 Bytes

Versions: 7

Compression:

Stored size: 728 Bytes

Contents

require "spec_helper"

describe Berkshelf::Validator do
  describe "#validate_files" do
    let(:cookbook) { double("cookbook", cookbook_name: "cookbook", path: "path") }

    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)
    end

    it "does not raise an error when the cookbook is valid" do
      allow(Dir).to receive(:glob).and_return(["/there-are/no-spaces/in-this/recipes/default.rb"])
      expect do
        subject.validate_files(cookbook)
      end.to_not raise_error
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
berkshelf-8.0.5 spec/unit/berkshelf/validator_spec.rb
berkshelf-8.0.2 spec/unit/berkshelf/validator_spec.rb
berkshelf-8.0.1 spec/unit/berkshelf/validator_spec.rb
berkshelf-8.0.0 spec/unit/berkshelf/validator_spec.rb
berkshelf-7.2.2 spec/unit/berkshelf/validator_spec.rb
berkshelf-7.2.1 spec/unit/berkshelf/validator_spec.rb
berkshelf-7.2.0 spec/unit/berkshelf/validator_spec.rb