Sha256: f0dd62215d3711c3897aa57759359f12c4130bafcb70e53bb1834155135c187d

Contents?: true

Size: 1023 Bytes

Versions: 3

Compression:

Stored size: 1023 Bytes

Contents

require 'hiera-puppet-helper'

# optional, this should be the path to where the hiera data config file is in this repo
# You must update this if your actual hiera data lives inside your module.
# I only assume its data, but it could be anything
hiera_config_file = File.expand_path(File.join(File.dirname(__FILE__), '..','data', 'hiera.yaml'))

# hiera_config and hiera_data are mutually exclusive contexts.

shared_context :hiera do
    # example only,
    let(:hiera_data) do
        {:some_key => "some_value" }
    end
end

shared_context :linux_hiera do
    # example only,
    let(:hiera_data) do
        {:some_key => "some_value" }
    end
end

# In case you want a more specific set of mocked hiera data for windows
shared_context :windows_hiera do
    # example only,
    let(:hiera_data) do
        {:some_key => "some_value" }
    end
end

# you cannot use this in addition to any of the hiera_data contexts above
shared_context :real_hiera_data do
    let(:hiera_config) do
       hirea_config_file
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puppet-retrospec-0.7.2 lib/retrospec/templates/module_files/spec/shared_contexts.rb
puppet-retrospec-0.7.0 lib/retrospec/templates/module_files/spec/shared_contexts.rb
puppet-retrospec-0.6.1 lib/retrospec/templates/module_files/spec/shared_contexts.rb