Skip to content

Commit

Permalink
migrate to our spec_helper.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Nov 23, 2017
1 parent 8966a85 commit 2a7095c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
2 changes: 0 additions & 2 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---
.travis.yml:
secure: "bca3Ebj/IE9a1X/BpLPVpMYw/zx9VkFRp1WjQZ437jYnpjyl2M/bC1cyW/A7TnzPX7WOpemT5+CVlVF/WE6f0Hrn6EqSzNwrVF8HOkGD8LqVLopXkaEn1zjcrhF4uMaleDpnNxQUx9nMAnqksiw2xphF1yxABqMt3l42SV7ajVw="
spec/spec_helper.rb:
unmanaged: true
7 changes: 0 additions & 7 deletions spec/classes/confluence_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
}
end

let :facts do
{
os: { family: 'RedHat' },
operatingsystem: 'RedHat'
}
end

it { is_expected.to contain_service('confluence') }
it { is_expected.to compile.with_all_deps }
end
Expand Down
2 changes: 2 additions & 0 deletions spec/default_module_facts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
augeasversion: '1.8.1'
31 changes: 21 additions & 10 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,30 @@
require 'rspec-puppet-facts'
include RspecPuppetFacts

unless RUBY_VERSION =~ %r{^1.9}
if Dir.exist?(File.expand_path('../../lib', __FILE__))
require 'coveralls'
Coveralls.wear!
require 'simplecov'
require 'simplecov-console'
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::Console
]
SimpleCov.start do
track_files 'lib/**/*.rb'
add_filter '/spec'
add_filter '/vendor'
add_filter '/.vendor'
end
end

require 'puppetlabs_spec_helper/module_spec_helper'
RSpec.configure do |c|
c.default_facts = {
osfamily: 'Debian',
augeasversion: '1.0.0',
staging_http_get: 'curl',
path: '/usr/local/bin:/usr/bin:/bin',
confluence_version: '5.5.6',
puppetversion: '3.7.4'
default_facts = {
puppetversion: Puppet.version,
facterversion: Facter.version
}
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__))
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_module_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_module_facts.yml', __FILE__))
c.default_facts = default_facts
end

# vim: syntax=ruby

0 comments on commit 2a7095c

Please sign in to comment.