Created
September 13, 2013 14:24
-
-
Save jblaine/6551437 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'line-cookbook::tester' do | |
let(:chef_run) { ChefSpec::ChefRunner.new.converge 'line-cookbook::tester' } | |
it 'creates dangerfile' do | |
expect(chef_run).to create_cookbook_file '/tmp/dangerfile' | |
expect(chef_run).to create_file_with_content '/tmp/dangerfile', 'HI I AM STRING' | |
file = chef_run.cookbook_file '/tmp/dangerfile' | |
expect(file).to be_owned_by('root') | |
expect(file).to be_owned_by('root') | |
expect(file.mode).to eq("00644") | |
end | |
end | |
------------------------------------------------------------------------------------------- | |
[jblaine@dev:~/src/line-cookbook] delete_lines(+15/-3) ± rspec | |
Failures: | |
1) line-cookbook::tester creates dangerfile | |
Failure/Error: expect(chef_run).to create_file_with_content '/tmp/dangerfile', 'HI I AM STRING' | |
ArgumentError: | |
Cannot find a platform_family for node[chefspec.local] | |
# ./spec/tester_spec.rb:8:in `block (2 levels) in <top (required)>' | |
Finished in 0.01799 seconds | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/tester_spec.rb:6 # line-cookbook::tester creates dangerfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment