Skip to content

Commit

Permalink
ChefSpec does not support node attributes in assertions per http://st…
Browse files Browse the repository at this point in the history
…ackoverflow.com/a/21763443

Add stub for golang cookbooks shell out to grep
  • Loading branch information
jhmartin committed Jul 14, 2014
1 parent b21d6bb commit 00b703a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/unit/recipes/install_source_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
require 'spec_helper'

describe_recipe 'consul::install_binary' do
describe_recipe 'consul::install_source' do
before do
stub_command("/usr/local/go/bin/go version | grep \"go1.2 \"").and_return(false)
end

it { expect(chef_run).to include_recipe('golang::default') }
it { expect(chef_run).to create_directory("#{node[:golang][:gohome]}/src/github.com/hashicorp") }
it { expect(chef_run).to create_directory('/opt/go/src/github.com/hashicorp') }
it { expect(chef_run).to checkout_git('https://github.com/hashicorp/consul.git') }
it { expect(chef_run.link('/usr/bin/local/consul')).to link_to('/opt/go/bin') }
it { expect(chef_run).to include_recipe('consul::_service') }
Expand Down

0 comments on commit 00b703a

Please sign in to comment.