Skip to content

Instantly share code, notes, and snippets.

@kjetilho
Last active December 2, 2015 14:57
Show Gist options
  • Save kjetilho/3ff3eccdec86a1e43447 to your computer and use it in GitHub Desktop.
Save kjetilho/3ff3eccdec86a1e43447 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe 'bareos::client::fileset' do
context "basic fileset" do
let(:title) { 'basic' }
let(:params) { { :include_paths => ['/custom'] } }
let(:facts) { RSpec.configuration.default_facts }
let(:pre_condition) { <<-eot
class bareos::client {
$client_name = $::fqdn
}
include bareos::client
eot
}
it { should compile.with_all_deps }
it do
expect(exported_resources).to contain_bareos__fileset_definition("#{facts[:fqdn]}-basic")
.with_include_paths(['/custom'])
.with_acl_support(true)
.with_ignore_changes(true)
.with_exclude_dir_containing('.nobackup')
end
end
end
this works.
require 'puppetlabs_spec_helper/module_spec_helper'
# Get facts from a gem
require 'rspec-puppet-facts'
include RspecPuppetFacts
# Default environment for tests
RSpec.configure do |c|
c.include Support::ExportedResources # see above
c.hiera_config = 'spec/fixtures/hiera/hiera.yaml'
c.default_facts = { :fqdn => 'node.example.com' }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment