Skip to content

Commit

Permalink
Modify default_spec to fix unit test failures caused by updates for 0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Magrath committed Aug 3, 2015
1 parent 27d2a7b commit 1699ac6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spec/unit/recipes/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
end

it 'renders a prometheus job configuration file and notifies prometheus to restart' do
resource = chef_run.template('/opt/prometheus/prometheus.conf')
resource = chef_run.template('/opt/prometheus/prometheus.yml')
expect(resource).to notify('service[prometheus]').to(:restart)
end

Expand All @@ -42,7 +42,7 @@
context 'source' do
let(:chef_run) do
ChefSpec::SoloRunner.new(file_cache_path: '/var/chef/cache') do |node|
node.set['prometheus']['source']['version'] = '0.12.0'
node.set['prometheus']['version'] = '0.15.1'
node.set['prometheus']['install_method'] = 'source'
end.converge(described_recipe)
end
Expand All @@ -58,9 +58,9 @@
end

it 'checks out prometheus from github' do
expect(chef_run).to checkout_git("#{Chef::Config[:file_cache_path]}/prometheus-0.12.0").with(
expect(chef_run).to checkout_git("#{Chef::Config[:file_cache_path]}/prometheus-0.15.1").with(
repository: 'https://github.com/prometheus/prometheus.git',
revision: '0.12.0'
revision: '0.15.1'
)
end

Expand Down Expand Up @@ -147,16 +147,16 @@
context 'binary' do
let(:chef_run) do
ChefSpec::SoloRunner.new do |node|
node.set['prometheus']['source']['version'] = '0.12.0'
node.set['prometheus']['version'] = '0.15.1'
node.set['prometheus']['install_method'] = 'binary'
end.converge(described_recipe)
end

it 'runs ark with correct attributes' do
expect(chef_run).to put_ark('prometheus').with(
url: 'https://sourceforge.net/projects/prometheusbinary/files/prometheus-ubuntu14.tar.bz2/',
checksum: '10b24708b97847ba8bdd41f385f492a8edd460ec3c584c5b406a6c0329cc3a4e',
version: '0.12.0',
url: 'https://github.com/prometheus/prometheus/releases/download/0.15.1/prometheus-0.15.1.linux-amd64.tar.gz',
checksum: '4b283ce4bf194619d03883a9cf23bd4566a5e5c3cc483b1192a1cd3c4a756118',
version: '0.15.1',
prefix_root: Chef::Config['file_cache_path'],
path: '/opt',
owner: 'prometheus',
Expand All @@ -165,10 +165,10 @@
end

it 'runs ark with given file_extension' do
chef_run.node.set['prometheus']['file_extension'] = 'tar.bz2'
chef_run.node.set['prometheus']['file_extension'] = 'tar.gz'
chef_run.converge(described_recipe)
expect(chef_run).to put_ark('prometheus').with(
extension: 'tar.bz2'
extension: 'tar.gz'
)
end

Expand Down

0 comments on commit 1699ac6

Please sign in to comment.