ac06cb7c96
This patch aim to update our specs test in order to work with the rspec-puppet release 2.0.0, in the mean time, we update rspec syntax order to be prepared for rspec 3.x move. In details: * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0 * Use shared_examples "a Puppet::Error" for puppet::error tests * * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x) * * Fix spec tests for rspec-puppet 2.0.0 * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper) Change-Id: Ida94605916fe26dd4c5fb328f79c4e787d29dcf5 Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
37 lines
789 B
Ruby
37 lines
789 B
Ruby
require 'puppet'
|
|
require 'spec_helper'
|
|
require 'puppet/provider/neutron_router_interface/neutron'
|
|
|
|
provider_class = Puppet::Type.type(:neutron_router_interface).
|
|
provider(:neutron)
|
|
|
|
describe provider_class do
|
|
|
|
let :interface_attrs do
|
|
{
|
|
:name => 'router:subnet',
|
|
:ensure => 'present',
|
|
}
|
|
end
|
|
|
|
describe 'when accessing attributes of an interface' do
|
|
let :resource do
|
|
Puppet::Type::Neutron_router_interface.new(interface_attrs)
|
|
end
|
|
|
|
let :provider do
|
|
provider_class.new(resource)
|
|
end
|
|
|
|
it 'should return the correct router name' do
|
|
expect(provider.router_name).to eql('router')
|
|
end
|
|
|
|
it 'should return the correct subnet name' do
|
|
expect(provider.subnet_name).to eql('subnet')
|
|
end
|
|
|
|
end
|
|
|
|
end
|