On Oct 8, 2009, at 10:48 AM, David Lutterkort wrote:

>
> On Wed, 2009-10-07 at 13:35 -0700, Luke Kanies wrote:
>> On Oct 6, 2009, at 11:40 AM, David Lutterkort wrote:
>>> -              context whild files/foo will be prepended"
>>> +        desc "Optional context path. This value is prepended to the
>>> paths of all changes if the path is relative. If INCL is set,
>>> defaults to '/files' + INCL, otherwise the empty string"
>>>        defaultto ""
>>> +        munge do |value|
>>> +            if value.empty? and resource[:incl]
>>> +                "/files" + resource[:incl]
>>> +            else
>>> +                value
>>> +            end
>>> +        end
>>
>> I'm not confident the behaviour matches the docs.  It'd be nice to  
>> see
>> a couple of nices proving that this behaves appropriately.
>
> What specifically is your concern ? There's this test:
>
>>> +        it "should set the context when a specific file is used" do
>>> +            augeas.new(:name => :no_incl, :lens =>
>>> "Hosts.lns", :incl => "/etc/hosts")[:context].should == "/files/etc/
>>> hosts"
>>> +        end
>>> +    end
>
> and another test to check that the default context is hte empty  
> string.
> I'd be happy to add more tests if you tell me what they should test.
>
> If the concern is that resource[:incl] may not have been set at that
> point, I would have liked to make this a type-level munge (similar to
> the validate), but couldn't find a way to do that.


Sorry, I somehow missed that this was testing the value, rather than  
testing that the context was set on disk or whatever.  I see now, and  
the code is fine.  +1

-- 
Do you realize if it weren't for Edison we'd be watching TV by
candlelight? -- Al Boliska
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.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