On 2/03/09 23:33, Luke Kanies wrote: > > > On Mar 1, 2009, at 11:59 AM, Brice Figureau wrote: > >> Signed-off-by: Brice Figureau <[email protected]> >> --- >> spec/unit/parser/ast/collection.rb | 63 ++++++++++ > > Do these tests replace test/ tests? This is a new file, so it seems > possible.
No I don't think so, it's just that there wasn't any unit test for this class, so I added it. When I started working on the language stuff, there was only a handful unit tests of AST classes, so each time I was doing stuff on this part, I added more coverage. Since this patch is old, it has some of those bits. >> spec/unit/parser/collector.rb | 176 ++++++++++++++++++++ >> +++------ >> test/data/snippets/collection_override.pp | 8 ++ >> test/language/snippets.rb | 6 + >> 4 files changed, 216 insertions(+), 37 deletions(-) >> create mode 100755 spec/unit/parser/ast/collection.rb >> create mode 100644 test/data/snippets/collection_override.pp [snip] >> >> + >> + it "should not override already overriden resources for this >> same collection in a previous run" do > > I see: This is why the @collected exists. > > It seems like there should be a cleaner way to do this, but... This is > certainly the easiest. Seems messy, but I don't see a better way. Yes, if you see something better... The other alternatives weren't good either (ie adding the list of collector to the resources and such...) [snip] >> + it "should override all exported collected resources if >> collector has an override" do > > Good catch. This is an interesting problem, because you could have > two overrides across different hosts that conflict. I think we can > leave it in for now and just say 'there be dragons', but it's going to > come up, you can bet. Crazy users. :) I won't pretend I thought about all the implications of this patch, but this one crossed my mind and I couldn't find any satisfying solution. -- 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 -~----------~----~----~----~------~----~------~--~---
