Skip to content

Commit

Permalink
add step_into during chefspec tests to correctly test custom resources
Browse files Browse the repository at this point in the history
  • Loading branch information
thmttch committed Aug 21, 2014
1 parent 869365b commit f4ba1a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
context "on #{platform} #{version}" do

let(:chef_run) do
ChefSpec::Runner.new(platform: platform, version: version) do |node|
ChefSpec::Runner.new(
platform: platform,
version: version,
step_into: [ 'anaconda_package' ]) do |node|
#node.set['foo']['users'] = users
end
end
Expand All @@ -26,7 +29,7 @@
expect(chef_run).to render_file(installer_config_path).with_content(/.*\n.*\n.*\n.*/)
end

it 'exposes the conda_package resource' do
it 'exposes the anaconda_package resource' do
chef_run.converge('recipe[anaconda::package_tests]')

expect(chef_run).to install_conda_package('astroid')
Expand Down
2 changes: 1 addition & 1 deletion test/integration/default/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

describe 'general tests' do

it 'installs conda 2.0.1' do
it 'installs anaconda 2.0.1' do
command('/opt/anaconda/2.0.1/bin/conda --version').should return_stdout 'conda 3.5.5'
end

Expand Down

0 comments on commit f4ba1a4

Please sign in to comment.