Sha256: e2532b3810ef8a0d0c27c64d9779dbe82bd3da1cf3584956ff967ca50a695771

Contents?: true

Size: 989 Bytes

Versions: 1

Compression:

Stored size: 989 Bytes

Contents

require 'pathname'
require 'beaker-rspec'
require 'beaker/puppet_install_helper'

run_puppet_install_helper

RSpec.configure do |c|
  proj_root   = File.expand_path(File.join(File.dirname(__FILE__), '..'))
  modules_dir = Pathname.new("#{proj_root}/spec/fixtures/modules")

  c.before :suite do
    hosts.each do |host|

      # copy all fixtures module dirs to host (if any)
      modules_dir.each_child do |module_dir|
        unless File.symlink?(module_dir)
          copy_module_to(host, :source => module_dir.to_s, :module_name => module_dir.basename.to_s)
        end
      end

      # copy this main module to host
      copy_module_to(host, :source => proj_root, :module_name => '<%= module_name %>')
    end
  end
end

shared_examples "an idempotent resource" do
  it 'should apply without errors' do
    apply_manifest(manifest, :catch_failures => true)
  end

  it 'should apply a second time without changes' do
    apply_manifest(manifest, :catch_changes => true)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
puppet-magnum-4.0.3 generator_files/spec/spec_helper_acceptance.rb.erb