Files
cookbook-openstack-common/spec/default_spec.rb
galstrom21 ffe0d05a0d Refactoring chefspec tests
Change-Id: I35dfca684039512e2a238466ff7df5f3fd34d956
Addresses: blueprint refactor-spec-files
Closes-Bug: 1282996
2014-02-26 20:05:04 -06:00

27 lines
812 B
Ruby

# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-common::default' do
describe 'ubuntu' do
let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
node.set['lsb']['codename'] = 'precise'
runner.converge(described_recipe)
end
it 'installs ubuntu-cloud-keyring package' do
expect(chef_run).to install_package 'ubuntu-cloud-keyring'
end
it 'configures openstack repository' do
# Using cookbook(apt) LWRP custom matcher
# https://github.com/sethvargo/chefspec#packaging-custom-matchers
expect(chef_run).to add_apt_repository('openstack-ppa').with(
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
components: ['precise-updates/havana', 'main'])
end
end
end