Sha256: 99d00bec872630a702c29c073f705edac57cc675de690be7048afa4e18d2be1c

Contents?: true

Size: 918 Bytes

Versions: 41

Compression:

Stored size: 918 Bytes

Contents

# encoding: utf-8
# author: Dominik Richter
# author: Christoph Hartmann

require 'helper'

describe Fetchers::Tar do
  let(:fetcher) { Fetchers::Tar }

  it 'registers with the fetchers registry' do
    reg = Inspec::Fetcher.registry
    _(reg['tar']).must_equal fetcher
  end

  describe 'applied to a tar archive' do
    let(:target) { MockLoader.profile_tgz('complete-profile') }
    let(:res) { fetcher.resolve(target) }

    it 'must be resolved' do
      _(res).must_be_kind_of fetcher
    end

    it 'must contain all files' do
      _(res.files.sort).must_equal %w{inspec.yml libraries libraries/testlib.rb
        controls controls/filesystem_spec.rb}.sort
    end

    it 'must not read if the file isnt included' do
      _(res.read('file-not-in-archive')).must_be_nil
    end

    it 'must read the contents of the file' do
      _(res.read('inspec.yml')).must_match /^name: complete$/
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
inspec-0.30.0 test/unit/fetchers/tar_test.rb
inspec-0.29.0 test/unit/fetchers/tar_test.rb
inspec-0.28.1 test/unit/fetchers/tar_test.rb
inspec-0.28.0 test/unit/fetchers/tar_test.rb
inspec-0.27.1 test/unit/fetchers/tar_test.rb
inspec-0.27.0 test/unit/fetchers/tar_test.rb
inspec-0.26.0 test/unit/fetchers/tar_test.rb
inspec-0.25.0 test/unit/fetchers/tar_test.rb
inspec-0.24.0 test/unit/fetchers/tar_test.rb
inspec-0.23 test/unit/fetchers/tar_test.rb
inspec-0.22.1 test/unit/fetchers/tar_test.rb
inspec-0.22.0 test/unit/fetchers/tar_test.rb
inspec-0.21.6 test/unit/fetchers/tar_test.rb
inspec-0.21.5 test/unit/fetchers/tar_test.rb
inspec-0.21.4 test/unit/fetchers/tar_test.rb
inspec-0.21.3 test/unit/fetchers/tar_test.rb
inspec-0.21.2 test/unit/fetchers/tar_test.rb
inspec-0.21.1 test/unit/fetchers/tar_test.rb
inspec-0.21.0 test/unit/fetchers/tar_test.rb
inspec-0.20.1 test/unit/fetchers/tar_test.rb