
This is the initial commit for puppet-zaqar. It has been automatically generated using cookiecutter[1] and msync[2] [1] https://github.com/openstack/puppet-openstack-cookiecutter [2] https://github.com/openstack/puppet-modulesync-configs Change-Id: Iaca8f89dd22320ec0e08bfb8ec9b5912ad68c9fb Co-Authored-By: yguenane@redhat.com
38 lines
1.1 KiB
Ruby
38 lines
1.1 KiB
Ruby
# these tests are a little concerning b/c they are hacking around the
|
|
# modulepath, so these tests will not catch issues that may eventually arise
|
|
# related to loading these plugins.
|
|
# I could not, for the life of me, figure out how to programatcally set the modulepath
|
|
$LOAD_PATH.push(
|
|
File.join(
|
|
File.dirname(__FILE__),
|
|
'..',
|
|
'..',
|
|
'..',
|
|
'fixtures',
|
|
'modules',
|
|
'inifile',
|
|
'lib')
|
|
)
|
|
require 'spec_helper'
|
|
provider_class = Puppet::Type.type(:zaqar_config).provider(:ini_setting)
|
|
describe provider_class do
|
|
|
|
it 'should default to the default setting when no other one is specified' do
|
|
resource = Puppet::Type::Zaqar_config.new(
|
|
{:name => 'DEFAULT/foo', :value => 'bar'}
|
|
)
|
|
provider = provider_class.new(resource)
|
|
expect(provider.section).to eq('DEFAULT')
|
|
expect(provider.setting).to eq('foo')
|
|
end
|
|
|
|
it 'should allow setting to be set explicitly' do
|
|
resource = Puppet::Type::Zaqar_config.new(
|
|
{:name => 'dude/foo', :value => 'bar'}
|
|
)
|
|
provider = provider_class.new(resource)
|
|
expect(provider.section).to eq('dude')
|
|
expect(provider.setting).to eq('foo')
|
|
end
|
|
end
|