Sha256: c42f774b2bb37ecf2b06332bf363369d7d76009fd7c19fd28168819eeff35e73

Contents?: true

Size: 1.18 KB

Versions: 8

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

module Berkshelf
  describe InitGenerator do
    subject { InitGenerator }

    let(:target_root) { tmp_path.join("some_cookbook") }

    context "with default options" do
      before do
        generator = subject.new([], :path => target_root)
        capture(:stdout) { generator.invoke_all }
      end

      specify do
        target_root.should have_structure {
          file "Berksfile"
          no_file ".chefignore"
        }
      end
    end

    context "with a .chefignore" do
      before do
        generator = subject.new([], :path => target_root, :chefignore => true)
        capture(:stdout) { generator.invoke_all }
      end

      specify do
        target_root.should have_structure {
          file "Berksfile"
          file ".chefignore"
        }
      end
    end

    context "with a metadata entry in the Berksfile" do
      before do
        generator = subject.new([], :path => target_root, :metadata_entry => true)
        capture(:stdout) { generator.invoke_all }
      end

      specify do
        target_root.should have_structure {
          file "Berksfile" do
            contains "metadata"
          end
        }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
berkshelf-0.3.1 spec/unit/berkshelf/init_generator_spec.rb
berkshelf-0.3.0 spec/unit/berkshelf/init_generator_spec.rb
berkshelf-0.2.0 spec/unit/berkshelf/init_generator_spec.rb
berkshelf-0.1.5 spec/unit/berkshelf/init_generator_spec.rb
berkshelf-0.1.4 spec/unit/berkshelf/init_generator_spec.rb
berkshelf-0.1.3 spec/unit/berkshelf/init_generator_spec.rb
berkshelf-0.1.2 spec/unit/berkshelf/init_generator_spec.rb
berkshelf-0.1.1 spec/unit/berkshelf/init_generator_spec.rb