Sha256: 25a9467de09753258f0838691c42463b6e56545a8ca7584d2e87d2f0e2aec21d

Contents?: true

Size: 1.25 KB

Versions: 8

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

module Stove
  describe Cookbook do
    describe '#tarball' do
      let(:path) { generate_cookbook('basic', 'basic-cookbook') }
      it 'contains a directory with the same name as the cookbook' do
        tarball = Cookbook.new(path).tarball

        structure = []

        Zlib::GzipReader.open(tarball.path) do |gzip|
          Gem::Package::TarReader.new(gzip) do |tar|
            structure = tar.map(&:full_name).sort
          end
        end

        expect(structure).to eq(%w(
          basic/.foodcritic
          basic/CHANGELOG.md
          basic/README.md
          basic/attributes/default.rb
          basic/attributes/system.rb
          basic/definitions/web_app.rb
          basic/files/default
          basic/files/default/.authorized_keys
          basic/files/default/example.txt
          basic/files/default/patch.txt
          basic/libraries/magic.rb
          basic/metadata.json
          basic/providers/thing.rb
          basic/recipes/default.rb
          basic/recipes/system.rb
          basic/resources/thing.rb
          basic/templates/default
          basic/templates/default/.env.erb
          basic/templates/default/another.text.erb
          basic/templates/default/example.erb
        ))
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
stove-6.0.0 spec/integration/cookbook_spec.rb
stove-5.2.0 spec/integration/cookbook_spec.rb
stove-5.1.0 spec/integration/cookbook_spec.rb
stove-5.0.0 spec/integration/cookbook_spec.rb
stove-4.1.1 spec/integration/cookbook_spec.rb
stove-4.1.0 spec/integration/cookbook_spec.rb
stove-4.0.0 spec/integration/cookbook_spec.rb
stove-3.2.8 spec/integration/cookbook_spec.rb