Re: [Puppet Users] rspec cannot load required gems

2018-04-23 Thread Michael Watters
Thanks.  I found that adding "require 'parseconfig'" to the 
spec/spec_helper.rb file also allows the tests to run.  bundle exec is 
failing with dependency errors as well.


On Monday, April 23, 2018 at 5:24:08 PM UTC-4, Garrett Honeycutt wrote:
>
> On 4/23/18 4:38 PM, Michael Watters wrote: 
> > Has anybody used rspec-puppet to run tests using a function that 
> > requires external ruby gems?  I'm running unit tests on resources that 
> > call functions in the puppet_thycotic module however rspec is failing 
> > with an error as shown below. 
> > 
> > Failure/Error: require 'parseconfig' 
> >   
> >  Puppet::PreformattedError: 
> >Evaluation Error: Error while evaluating a Function Call, Could 
> > not autoload puppet/parser/functions/getsecret: cannot load such file -- 
> > parseconfig at 
> > 
> /home/username/projects/puppet/modules/example/spec/fixtures/modules/example/manifests/hostname.pp:32:20
>  
>
> > on node host.example.com 
> > 
> > I've installed the parseconfig gem using both the gem and puppet_gem 
> > providers but rspec still complains that it can't find the file.  Any 
> > idea how to resolve this?  Is there another directory where rspec looks 
> > for gem packages? 
> > 
>
> Hi Michael, 
>
> Try putting the gem in your Gemfile and using bundler when you invoke 
> rspec, such as `bundle exec rake spec_standalone` or `bundle exec rspec`. 
>
> Best regards, 
> -g 
>
> -- 
> Garrett Honeycutt 
> @learnpuppet 
> Puppet Training with LearnPuppet.com 
> Mobile: +1.206.414.8658 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c222ad53-e852-4ef2-a529-96fc5b8d83fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] rspec cannot load required gems

2018-04-23 Thread Garrett Honeycutt
On 4/23/18 4:38 PM, Michael Watters wrote:
> Has anybody used rspec-puppet to run tests using a function that
> requires external ruby gems?  I'm running unit tests on resources that
> call functions in the puppet_thycotic module however rspec is failing
> with an error as shown below.
> 
> Failure/Error: require 'parseconfig'
>      
>      Puppet::PreformattedError:
>        Evaluation Error: Error while evaluating a Function Call, Could
> not autoload puppet/parser/functions/getsecret: cannot load such file --
> parseconfig at
> /home/username/projects/puppet/modules/example/spec/fixtures/modules/example/manifests/hostname.pp:32:20
> on node host.example.com
> 
> I've installed the parseconfig gem using both the gem and puppet_gem
> providers but rspec still complains that it can't find the file.  Any
> idea how to resolve this?  Is there another directory where rspec looks
> for gem packages?
> 

Hi Michael,

Try putting the gem in your Gemfile and using bundler when you invoke
rspec, such as `bundle exec rake spec_standalone` or `bundle exec rspec`.

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8df25700-205c-8a3d-cb1b-b7238dbe43c3%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] rspec cannot load required gems

2018-04-23 Thread Michael Watters
Has anybody used rspec-puppet to run tests using a function that requires 
external ruby gems?  I'm running unit tests on resources that call 
functions in the puppet_thycotic module however rspec is failing with an 
error as shown below.

Failure/Error: require 'parseconfig'
 
 Puppet::PreformattedError:
   Evaluation Error: Error while evaluating a Function Call, Could not 
autoload puppet/parser/functions/getsecret: cannot load such file -- 
parseconfig at 
/home/username/projects/puppet/modules/example/spec/fixtures/modules/example/manifests/hostname.pp:32:20
 
on node host.example.com

I've installed the parseconfig gem using both the gem and puppet_gem 
providers but rspec still complains that it can't find the file.  Any idea 
how to resolve this?  Is there another directory where rspec looks for gem 
packages?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d65a1d78-0f98-43cc-ad6e-2d21196f1ec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.