| 1 |
# Load libraries from openstacklib here to simulate how they live together in a real puppet run (for provider unit tests) |
| 2 |
$LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'openstacklib', 'lib')) |
| 3 |
require 'puppetlabs_spec_helper/module_spec_helper' |
| 4 |
require 'shared_examples' |
| 5 |
require 'puppet-openstack_spec_helper/facts' |
| 6 |
|
| 7 |
RSpec.configure do |c| |
| 8 |
c.alias_it_should_behave_like_to :it_configures, 'configures' |
| 9 |
c.alias_it_should_behave_like_to :it_raises, 'raises' |
| 10 |
fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures')) |
| 11 |
|
| 12 |
c.hiera_config = File.join(fixture_path, 'hieradata/hiera.yaml') |
| 13 |
|
| 14 |
c.before(:all) do |
| 15 |
data = YAML.load_file(c.hiera_config) |
| 16 |
data[:yaml][:datadir] = File.join(fixture_path, 'hieradata') |
| 17 |
File.open(c.hiera_config, 'w') do |f| |
| 18 |
f.write data.to_yaml |
| 19 |
end |
| 20 |
end |
| 21 |
|
| 22 |
c.after(:all) do |
| 23 |
`git checkout -- #{c.hiera_config}` |
| 24 |
end |
| 25 |
end |
| 26 |
|
| 27 |
at_exit { RSpec::Puppet::Coverage.report! } |