On 18/09/08 20:47, Brice Figureau wrote:
> On 18/09/08 20:34, Paul Nasrat wrote:
>>> Unfortunately when parsing, the
>>> klass.new(hash)
>>> of Puppet::Parser::AST::ast returns nil
>>>
>>> How is it possible that new returns nil????
>>>
>>> I checked everything I could think of, it doesn't fail, no exceptions
>>> are raised, it just returns nil. Arghh.
>>>
>>> Any idea what could be wrong?
>>> Any idea on how I could chase down this?
>> If you have access to irc hop on to #puppet on freenode and I'll  
>> happily try help you debug it. I don't know that area of the code base  
>> but two heads may be better than one.
> 
> Thanks for the offer, I'm too tired tonight to understand the issue :-)
> 
>> If not - where is your git tree and I can have a look.
> 
> For the sake of history, the code can be found here:
> http://github.com/masterzen/puppet/tree/wip%2Fifexpr
> 

I found the issue :-)
And the root cause: I was too tired to think correctly
...
The ASY ComparisonOperator was used in the following rspec snippet:

AST::ComparisonOperator.expects(:new).with {
                  |h| h[:lval].is_a?(AST::Name) and 
h[:rval].is_a?(AST::Name) and h[:operator]=="<"
              }
@parser.parse("if 1 < 2 { $var = 1 }")

And for sure, the mock returns nil, hence the nil I saw in the parser 
debug output :-)

Thanks Paul, for the help, the case is closed now.
-- 
Brice Figureau
Days of Wonder
http://www.daysofwonder.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to