Last active
August 29, 2015 13:56
-
-
Save btisdall/8952428 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include_recipe "apt" | |
apt_repository 'brightbox-ruby' do | |
uri 'http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu' | |
distribution node['lsb']['codename'] | |
components ['main'] | |
keyserver 'keyserver.ubuntu.com' | |
key 'C3173AA6' | |
notifies :run, "execute[apt-get update]", :immediately | |
end | |
%w{ruby2.0 ruby2.0-dev rubygems ruby-switch}.each do |pkg| | |
package pkg do | |
action :install | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "spec_helper" | |
describe 'vagrant-dependencies::default' do | |
let(:chef_run) { ChefSpec::Runner.new.converge('vagrant-dependencies::default') } | |
it 'installs the package' do | |
expect(chef_run).to install_package 'ruby2.0' | |
end | |
it 'renders the bar file correctly' do | |
pending | |
expect(chef_run).to render_file('/tmp/barbar').with_content("Hubba: 9999\n") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failures: | |
1) vagrant-dependencies::default installs the package | |
Failure/Error: let(:chef_run) { ChefSpec::Runner.new.converge('vagrant-dependencies::default') } | |
NameError: | |
Cannot find a resource for apt_repository on chefspec version 0.6.1 | |
# ./recipes/default.rb:10:in `from_file' | |
# ./spec/default_spec.rb:4:in `block (2 levels) in <top (required)>' | |
# ./spec/default_spec.rb:7:in `block (2 levels) in <top (required)>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment