Commit 6da3b6ea authored by Tim Smith's avatar Tim Smith
Browse files

Fixup and speed up specs


Signed-off-by: default avatarTim Smith <tsmith@chef.io>
parent ada60718
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'erlang::esl' do
describe 'Debian Platform Family' do
cached(:chef_run_debian) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04')
.converge('erlang::esl')
end
......@@ -22,7 +22,7 @@ describe 'erlang::esl' do
describe 'RHEL Platform Family' do
cached(:chef_run_rhel) do
ChefSpec::ServerRunner.new(platform: 'centos', version: '7.3.1611')
ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611')
.converge('erlang::esl')
end
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'erlang::package' do
describe 'Debian Platform Family' do
let(:chef_run_debian) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '14.04')
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04')
end
let(:debian_converged) { chef_run_debian.converge('erlang::package') }
......@@ -39,7 +39,7 @@ describe 'erlang::package' do
describe 'RHEL Platform Family' do
cached(:chef_run_rhel) do
ChefSpec::ServerRunner.new(platform: 'centos', version: '7.3.1611')
ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611')
.converge('erlang::package')
end
......@@ -55,15 +55,4 @@ describe 'erlang::package' do
expect(chef_run_rhel).to install_package('erlang')
end
end
context 'RHEL 5' do
cached(:chef_run_rhel_5) do
ChefSpec::ServerRunner.new(platform: 'centos', version: '5.11')
.converge('erlang::package')
end
it 'creates the yum EPELErlangrepo repository' do
expect(chef_run_rhel_5).to create_yum_repository('EPELErlangrepo')
end
end
end
require 'spec_helper'
describe 'erlang::source' do
describe 'All Platforms' do
cached(:chef_run) { ChefSpec::ServerRunner.new.converge('erlang::source') }
describe 'On Debain Platform Family' do
cached(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge('erlang::source') }
it 'converges successfully' do
expect { :chef_run_rhel }.to_not raise_error
end
it 'includes the build-essential recipe' do
expect(chef_run).to include_recipe('build-essential')
it 'includes the build_essential resource' do
expect(chef_run).to install_build_essential('install compilation tools')
end
it 'contains bash[install-erlang] with action nothing' do
......@@ -17,6 +13,10 @@ describe 'erlang::source' do
expect(execute_resource).to do_nothing
end
it 'installs dep packages' do
expect(chef_run).to install_package(%w(tar libncurses5-dev openssl libssl-dev))
end
context 'Erlang source remote file' do
let(:erlang_source_file) { "#{Chef::Config[:file_cache_path]}/otp_src_#{chef_run.node['erlang']['source']['version']}.tar.gz" }
let(:remote_file_resource) { chef_run.remote_file(erlang_source_file) }
......@@ -31,20 +31,9 @@ describe 'erlang::source' do
end
end
describe 'Debian Platform Family' do
cached(:chef_run_debian) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '14.04')
.converge('erlang::source')
end
it 'installs dep packages' do
expect(chef_run_debian).to install_package(%w(tar libncurses5-dev openssl libssl-dev))
end
end
describe 'RHEL Platform Family' do
cached(:chef_run_rhel) do
ChefSpec::ServerRunner.new(platform: 'centos', version: '7.3.1611')
ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611')
.converge('erlang::source')
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment