2021-12-27 10:41:04 +09:00
|
|
|
# Load libraries here to simulate how they live together in a real puppet run (for provider unit tests)
|
|
|
|
$LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'inifile', 'lib'))
|
2014-11-16 16:23:00 -08:00
|
|
|
$LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'openstacklib', 'lib'))
|
2012-05-31 16:52:46 -07:00
|
|
|
require 'puppetlabs_spec_helper/module_spec_helper'
|
2013-05-02 18:03:12 +02:00
|
|
|
require 'shared_examples'
|
2016-09-30 13:21:39 -06:00
|
|
|
require 'puppet-openstack_spec_helper/facts'
|
2016-01-06 21:28:19 -07:00
|
|
|
|
2021-06-02 14:03:42 +09:00
|
|
|
fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))
|
|
|
|
|
2013-05-02 18:03:12 +02:00
|
|
|
RSpec.configure do |c|
|
2015-03-15 16:32:35 +01:00
|
|
|
c.alias_it_should_behave_like_to :it_configures, 'configures'
|
|
|
|
c.alias_it_should_behave_like_to :it_raises, 'raises'
|
2021-06-02 14:03:42 +09:00
|
|
|
|
|
|
|
c.module_path = File.join(fixture_path, 'modules')
|
2013-05-02 18:03:12 +02:00
|
|
|
end
|
2015-08-04 11:50:09 -07:00
|
|
|
|
2015-07-16 18:28:20 +02:00
|
|
|
RSpec::Matchers.define :be_absent do
|
|
|
|
match do |actual|
|
|
|
|
actual == :absent
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-08-04 11:50:09 -07:00
|
|
|
at_exit { RSpec::Puppet::Coverage.report! }
|
2015-09-05 15:55:09 -06:00
|
|
|
|
|
|
|
def setup_provider_tests
|
|
|
|
Puppet::Provider::Keystone.class_exec do
|
|
|
|
def self.reset
|
2015-11-18 18:38:50 +01:00
|
|
|
Puppet::Provider::Keystone.class_variable_set('@@default_domain_id', nil)
|
2015-09-05 15:55:09 -06:00
|
|
|
@domain_hash = nil
|
2016-03-30 13:00:58 +02:00
|
|
|
@users_name = nil
|
|
|
|
@projects_name = nil
|
2015-09-05 15:55:09 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|