Skip to content

Commit

Permalink
Merge pull request #2 from RightScale-Services-Cookbooks/curt-dev
Browse files Browse the repository at this point in the history
Make work on v14 Ubuntu RightImage
  • Loading branch information
rshade committed Feb 16, 2016
2 parents e7b74dc + 1912321 commit 4fa7020
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Installs/Configures fog'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.1'
version '0.2.0'

depends "build-essential"
depends "libxml2"
Expand Down
8 changes: 8 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe "build-essential::default"
include_recipe "libxml2::default"

if node['platform_family'] == "debian"
p= package "zlib1g-dev" do
action :nothing
end
p.run_action(:install)
end

chef_gem "fog" do
compile_time true if respond_to?(:compile_time)
version node['fog']['version']
Expand Down
19 changes: 17 additions & 2 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
require_relative 'spec_helper'

describe 'fog::default' do
before{
allow_any_instance_of(Chef::Recipe).to receive(:include_recipe).and_call_original
%w(build-essential::default libxml2::default).each do |recipe|
allow_any_instance_of(Chef::Recipe).to receive(:include_recipe).with(recipe)
end
}

let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
let(:chef_run_ubuntu) { ChefSpec::Runner.new(platform: 'ubuntu',
version: '14.04').converge(described_recipe) }

it "installs zlib package" do
expect(chef_run_ubuntu).to install_package("zlib1g-dev")
end

it 'includes build-essential' do
expect(chef_run).to include_recipe('build-essential::default')
expect_any_instance_of(Chef::Recipe).to receive(:include_recipe).with('build-essential::default')
chef_run
end

it 'includes libxml-devel' do
expect(chef_run).to include_recipe('libxml2::default')
expect_any_instance_of(Chef::Recipe).to receive(:include_recipe).with('libxml2::default')
chef_run
end

it 'installs fog gem' do
Expand Down

0 comments on commit 4fa7020

Please sign in to comment.