Created
January 24, 2012 23:12
-
-
Save cwebberOps/1673392 to your computer and use it in GitHub Desktop.
rspec-puppet... Doing it wrong
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
pwd: /Users/cwebber/projects/puppetmaster/puppet/modules/puppet | |
(15:47:56) cwebber@tron [~/projects/puppetmaster/puppet/modules/puppet] rspec | |
F | |
Failures: | |
1) puppet | |
Failure/Error: it { should contain_package('puppet').with_ensure('installed') } | |
Puppet::Error: | |
Could not find class puppet for genomics-58-102.bulk.ucr.edu at line 2 on node genomics-58-102.bulk.ucr.edu | |
# ./spec/classes/puppet_init_spec.rb:5:in `block (2 levels) in <top (required)>' | |
Finished in 0.05606 seconds | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/classes/puppet_init_spec.rb:5 # puppet |
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
(15:55:10) cwebber@tron [~/projects/puppetmaster/puppet/modules/puppet] pwd | |
/Users/cwebber/projects/puppetmaster/puppet/modules/puppet | |
(15:55:24) cwebber@tron [~/projects/puppetmaster/puppet/modules/puppet] ls -lR | |
total 0 | |
drwxr-xr-x 2 cwebber staff 68 Jan 24 11:41 files | |
drwxr-xr-x 3 cwebber staff 102 Jan 24 15:45 manifests | |
drwxr-xr-x 5 cwebber staff 170 Jan 24 15:05 spec | |
./files: | |
./manifests: | |
total 8 | |
-rw-r--r-- 1 cwebber staff 155 Jan 24 15:45 init.pp | |
./spec: | |
total 16 | |
drwxr-xr-x 3 cwebber staff 102 Jan 24 15:46 classes | |
-rw-r--r-- 1 cwebber staff 47 Jan 24 14:59 spec.opts | |
-rw-r--r-- 1 cwebber staff 203 Jan 24 15:05 spec_helper.rb | |
./spec/classes: | |
total 8 | |
-rw-r--r-- 1 cwebber staff 117 Jan 24 15:46 puppet_init_spec.rb | |
(15:55:34) cwebber@tron [~/projects/puppetmaster/puppet/modules/puppet] |
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
# = Class: puppet | |
# | |
# This class provides for some basics needed for running puppet | |
# | |
class puppet { | |
package { "puppet": | |
ensure => installed | |
} | |
} |
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
(15:59:37) cwebber@tron [~/projects/puppetmaster/puppet/modules/puppet] rspec | |
F | |
Failures: | |
1) puppet | |
Failure/Error: it { should contain_package('puppet').with_ensure('installed') } | |
Puppet::Error: | |
Could not parse for environment production: No file(s) found for import of '/Users/cwebber/.puppet/manifests/site.pp' at line 3 on node genomics-58-102.bulk.ucr.edu | |
# ./spec/classes/puppet_init_spec.rb:5:in `block (2 levels) in <top (required)>' | |
Finished in 0.01935 seconds | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/classes/puppet_init_spec.rb:5 # puppet | |
(15:59:42) cwebber@tron [~/projects/puppetmaster/puppet/modules/puppet] |
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 'puppet' do | |
it { should contain_package('puppet').with_ensure('installed') } | |
end |
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 'puppet' | |
require 'rubygems' | |
require 'mocha' | |
require 'rspec' | |
require 'rspec-puppet' | |
RSpec.configure do |c| | |
c.mock_with :mocha | |
# Setting this causes things to break in an even more interesting way... | |
# c.module_path = File.join(File.dirname(__FILE__), '../../') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you ever get a solution to https://gist.github.com/cwebberOps/1673392#file-basic_info-L11?