On Aug 7, 2009, at 4:06 PM, Markus wrote:
>
> On Fri, 2009-08-07 at 22:42 +0200, Brice Figureau wrote:
>> On 7/08/09 22:37, Markus wrote:
>>>> I'd say if we have an integration test that has a capitalized node
>>>> name that can be found via a differently-cased search, then I'd
>>>> consider that sufficient proof that it works.
>>>
>>> It doesn't work.
>>
>> Which is an issue. Can you send the test?
>
> I now think the test I was originally using was mocking/testing at the
> wrong level. Specifically, it was thwarting the loaded_code's
> munge_name method which is where Luke's concern about the hash being
> case sensitive is addressed.
>
> But I'm semi-stuck.
> [...]
> However, that's where I'm stuck. My understanding of the system isn't
> yet to a point where I can craft a test that would increase my
> confidence beyond this point, or that would convince anyone who isn't
> convinced by the above.
>
> Specifically, the levels of indirection are tangled enough that any
> test
> I write would be relying so heavily on the foregoing analysis in
> determining where, what, and how to mock/stub (and thus assuming it
> rather than testing it) that it would prove nothing.
[...]
I cannot reproduce this behaviour. I wrote the following integration
tests, which all pass:
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Parser::Parser do
before :each do
@loaded_code = Puppet::Parser::LoadedCode.new
@parser = Puppet::Parser::Parser.new :environment =>
"development", :loaded_code => @loaded_code
end
it "should look up class names insensitive to case" do
klass = @parser.newclass("Foo", :line => 50, :doc => "stuff")
@parser.find_hostclass("", "fOO").should equal(klass)
end
it "should look up definitions insensitive to case" do
klass = @parser.newdefine("Foo", :line => 50, :doc => "stuff")
@parser.find_definition("", "fOO").should equal(klass)
end
it "should look up nodes insensitive to case" do
klass = @parser.newnode("Foo", :line => 50, :doc => "stuff")
@parser.node("fOO").should_not be_nil # equality doesn't work
here
end
end
If someone can send me test Puppet code that doesn't work, I'll write
an integration test that finds the problem.
--
The conception of two people living together for twenty-five years
without having a cross word suggests a lack of spirit only to be
admired in sheep. --Alan Patrick Herbert
---------------------------------------------------------------------
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
-~----------~----~----~----~------~----~------~--~---