Sha256: c909f00c2efaab667738bcb799cbe24c95649217fda4def88327b582e384ec1b

Contents?: true

Size: 968 Bytes

Versions: 12

Compression:

Stored size: 968 Bytes

Contents

require 'rspec-puppet'
# we can't use psh, because it declares things that conflict with serverspec

username = ENV['TARGET_HOST']
environmentpath = "/etc/puppetlabs/code/environments"

if File.directory? "#{environmentpath}/#{username}_production"
  environment = "#{username}_production"
elsif File.directory? "#{environmentpath}/#{username}"
  environment = username
else
  raise "No environment exists for #{username}"
end

puts "   - Testing environment #{environment}"

RSpec.configure do |c|
  c.environmentpath = environmentpath
  c.module_path     = "#{environmentpath}/#{environment}/site"
  c.manifest        = "#{environmentpath}/#{environment}/manifests"

  # Adds to the built in defaults from rspec-puppet
  c.default_facts = {
    :ipaddress                 => '127.0.0.1',
    :kernel                    => 'Linux',
    :operatingsystem           => 'CentOS',
    :operatingsystemmajrelease => '7',
    :osfamily                  => 'RedHat',
  }
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
puppetfactory-0.6.5 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.6.4 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.6.3 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.6.2 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.6.1 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.6.0 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.5.9 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.5.8 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.5.7 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.5.6 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.5.5 lib/puppetfactory/dashboard/spec_helper.rb
puppetfactory-0.5.4 lib/puppetfactory/dashboard/spec_helper.rb