Hi Nan,

thanks for your answer.
With this modification:

diff --git a/spec/classes/puppetrspec_spec.rb
b/spec/classes/puppetrspec_spec.rb
index 9d06d79..80fae58 100644
--- a/spec/classes/puppetrspec_spec.rb
+++ b/spec/classes/puppetrspec_spec.rb
@@ -22,7 +22,7 @@ describe 'puppetrspec', :type => :class do
     context 'with ensure undef' do

         let :params do {
-            :ensure     => '# WHAT SHOULD WE USE HERE TO PASS PUPPET undef
VALUE ?#'
+            :ensure     =>  :undef
         } end

         it 'should have File with ensure absent' do


it fails with this error:

% rake spec
/usr/bin/ruby -S rspec spec/classes/puppetrspec_spec.rb --color
.F

Failures:

  1) puppetrspec with ensure undef should have File with ensure absent
     Failure/Error: should contain_file(filename).with_ensure('absent')
     Puppet::Error:
       Could not parse for environment production: Syntax error at ':';
expected '}' at line 4 on node ...
     # ./spec/classes/puppetrspec_spec.rb:30

Finished in 1.51 seconds
2 examples, 1 failure

Failed examples:

rspec ./spec/classes/puppetrspec_spec.rb:29 # puppetrspec with ensure undef
should have File with ensure absent


Same error with this modification:

diff --git a/spec/classes/puppetrspec_spec.rb
b/spec/classes/puppetrspec_spec.rb
index 9d06d79..63faa11 100644
--- a/spec/classes/puppetrspec_spec.rb
+++ b/spec/classes/puppetrspec_spec.rb
@@ -21,9 +21,9 @@ describe 'puppetrspec', :type => :class do

     context 'with ensure undef' do

-        let :params do {
-            :ensure     => '# WHAT SHOULD WE USE HERE TO PASS PUPPET undef
VALUE ?#'
-        } end
+        let(:params) {{
+            :ensure     =>  :undef
+        }}


If you have any other idea, let me know :-)

Cheers

RĂ©mi



On Tue, Apr 22, 2014 at 10:53 AM, Nan Liu <nan....@gmail.com> wrote:

> On Tue, Apr 22, 2014 at 3:08 AM, Remi Ferrand <
> remi.mathieu.ferr...@gmail.com> wrote:
>
>> Thank you for your answer, but with my tests it seems that passing Ruby
>> *nil* value to puppet doesn't result in puppet *undef* value...
>> This is strange considering that puppet *undef* value results in ruby
>> *nil* value in templates...
>>
>
> Off the top of my head, I think it's a symbol:
>
> let(:params) {{
>   :package_provider => :undef,
> }}
>
> Nan
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/6nL2eROH8is/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CACqVBqDs8jsbAyndQfxgA0KF_yvEro-1kstxm7pDbR%2BtSeTm%3DQ%40mail.gmail.com<https://groups.google.com/d/msgid/puppet-users/CACqVBqDs8jsbAyndQfxgA0KF_yvEro-1kstxm7pDbR%2BtSeTm%3DQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAMTZwMJcm37WYzEgumqM4szXpzHn1qfO4eYb_CLGEfGFCzAdCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to