Sha256: 3cb76a09b7c87715599f3db0b60274c4d29512133f805ded1e8254da2c896bea

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

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

require 'helper'

def load_profile(name)
  pwd = File.dirname(__FILE__)
  Inspec::Profile.from_path("#{pwd}/mock/profiles/#{name}")
end

describe Inspec::Profile do
  before {
    # mock up the profile runner
    # TODO: try to take the real profile runner here;
    # currently it's stopped at test runner conflicts
    class Inspec::Profile::Runner
      def initialize(opts) end
      def add_tests(tests) end
      def rules
        {}
      end
    end
  }

  describe 'with empty profile' do
    let(:profile) { load_profile('empty') }

    it 'has no metadata' do
      profile.params[:name].must_be_nil
    end

    it 'has no rules' do
      profile.params[:rules].must_equal({})
    end
  end

  describe 'with normal metadata in profile' do
    let(:profile) { load_profile('metadata') }

    it 'has metadata' do
      profile.params[:name].must_equal 'metadata profile'
    end

    it 'has no rules' do
      profile.params[:rules].must_equal({})
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
inspec-0.9.7 test/unit/profile_test.rb
inspec-0.9.6 test/unit/profile_test.rb
inspec-0.9.5 test/unit/profile_test.rb
inspec-0.9.4 test/unit/profile_test.rb
inspec-0.9.3 test/unit/profile_test.rb
inspec-0.9.2 test/unit/profile_test.rb
inspec-0.9.1 test/unit/profile_test.rb
inspec-0.9.0 test/unit/profile_test.rb