Questions tagged [rspec-puppet]

rspec-puppet is a framework for testing Puppet code with the rspec BDD framework

http://rspec-puppet.com/

https://github.com/rodjek/rspec-puppet

49 questions
0
votes
1 answer

Dynamic value assign in rspec-puppet

Is there any option to assign values for parameters dynamically in rspec-puppet? Below is my sample rspec-puppet test case. Right now, I've hard-coded all the FQDN and hostname details. Is it possible to assign these value dynamically? let :facts…
Puppeteer
  • 63
  • 1
  • 7
0
votes
2 answers

how to add template file in rspec-puppet

I have below manifests for sudo user, loading template file class sudo { if $::operatingsystemmajrelease < 7 { $variable = $::operatingsystemmajrelease ? { '6' => $::fqdn, } file { '/etc/sudoers' : ensure => present, …
Puppeteer
  • 63
  • 1
  • 7
0
votes
1 answer

rspec-puppet: Puppet could not find declared class

I'm learning to use rspec to do unit testing on my puppet module, but somehow my simple module "rspec_test" just couldn't pass the testing. The module just contains a init.pp file which looks like this: init.pp class rspec_test { class {…
YueQi Li
  • 303
  • 4
  • 15
0
votes
1 answer

Undefined method `find_by_name' for Gem::Specification:Class

I created the spec/ structure for my puppet module using rspec-puppet-init. However, I am getting this strange error: Undefined method find_by_name for Gem::Specification:Class. I am running ruby 1.8.7 for RHEL6. $ rake spec (in…
Engineer2021
  • 3,288
  • 6
  • 29
  • 51
1 2 3
4