Sha256: 20472b693c04a6fb6a1c520443591e6c8d40d6165aeaaa2c5b957e709d13271d

Contents?: true

Size: 898 Bytes

Versions: 42

Compression:

Stored size: 898 Bytes

Contents

require 'spec_helper'

describe Ridley::Chef::Chefignore do
  describe '.initialize' do
    let(:path) { tmp_path.join('chefignore-test') }
    before { FileUtils.mkdir_p(path) }

    it 'finds the nearest chefignore' do
      target = path.join('chefignore').to_s
      FileUtils.touch(target)
      expect(described_class.new(path).filepath).to eq(target)
    end

    it 'finds a chefignore in the `cookbooks` directory' do
      target = path.join('cookbooks', 'chefignore').to_s
      FileUtils.mkdir_p(path.join('cookbooks'))
      FileUtils.touch(target)
      expect(described_class.new(path).filepath).to eq(target)
    end

    it 'finds a chefignore in the `.chef` directory' do
      target = path.join('.chef', 'chefignore').to_s
      FileUtils.mkdir_p(path.join('.chef'))
      FileUtils.touch(target)
      expect(described_class.new(path).filepath).to eq(target)
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
ridley-5.1.1 spec/unit/ridley/chef/chefignore_spec.rb
ridley-5.1.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-5.0.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.6.1 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.6.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.5.1 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.5.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.4.3 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.4.2 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.4.1 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.4.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.3.2 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.3.1 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.3.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.2.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.1.2 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.1.1 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.1.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-4.0.0 spec/unit/ridley/chef/chefignore_spec.rb
ridley-3.1.0 spec/unit/ridley/chef/chefignore_spec.rb