Skip to content

Commit

Permalink
updated test suite for chefspec 1.0.0.rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman committed Apr 22, 2013
1 parent d4ab818 commit f07815f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ group :test do
gem "tailor", "~> 1.1" # Ruby style
gem "foodcritic", "~> 1.6" # Lint testing
gem "berkshelf", "~> 1.0"
gem "chefspec", "~> 0.7"
gem "fauxhai", "~> 0.0"
gem "moneta", "< 0.7.0" # See http://tickets.opscode.com/browse/CHEF-3721
gem "chefspec", "~> 1.0.0.rc1" # See https://github.com/acrmp/chefspec/issues/93
end
26 changes: 18 additions & 8 deletions spec/dd-agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
# This recipe needs to have an api_key, otherwise `raise` is called.
# It also depends on specific platofrm versions for software install
context 'when using a debian-family distro' do
before do
Fauxhai.mock(:platform => 'ubuntu', :version => '12.04') do |node|
node['datadog'] = { :api_key => "somethingnotnil" }

let(:chef_run) do
ChefSpec::ChefRunner.new(platform: 'ubuntu', version: '12.04') do |node|
node.set['datadog'] = {
'api_key' => "somethingnotnil"
}
end
end

let (:chef_run) { ChefSpec::ChefRunner.new.converge 'datadog::dd-agent' }
before do
chef_run.converge 'datadog::dd-agent'
end

it 'sets up an apt repository' do
pending "step into apt"
Expand All @@ -35,13 +40,18 @@
end

context 'when using a redhat-family distro above 6.x' do
before do
Fauxhai.mock(:platform => 'centos', :version => '6.3') do |node|
node['datadog'] = { :api_key => "somethingnotnil" }

let(:chef_run) do
ChefSpec::ChefRunner.new(platform: 'centos', version: '6.3') do |node|
node.set['datadog'] = {
'api_key' => "somethingnotnil"
}
end
end

let (:chef_run) { ChefSpec::ChefRunner.new.converge 'datadog::dd-agent' }
before do
chef_run.converge 'datadog::dd-agent'
end

it 'sets up the EPEL repository' do
pending "step intp yum::epel?"
Expand Down
9 changes: 7 additions & 2 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
require 'spec_helper'

describe 'datadog::default' do
let (:chef_run) { ChefSpec::ChefRunner.new.converge 'datadog::default' }

it 'should do nothing' do
context 'when converging this recipe' do

let(:chef_run) { ChefSpec::ChefRunner.new.converge 'datadog::default' }

it 'should do nothing' do
end

end

end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
require 'chefspec'
require 'fauxhai'

0 comments on commit f07815f

Please sign in to comment.