Open mcallaway opened 10 years ago
Sorry for the extremely late reply.
This is kind of by design, as the idea with the augparse() function is that you'd supply a result tree as a string in the first argument and the generated tree will be compared against the expected string. The default of '?' is a shortcut (IIRC) so the test will fail, but will output the expected tree, which you can copy and paste so it passes next time.
I could add an option in if you like to make the behaviour configurable? That way we could keep the above, and also allow just using '?' if you want to simply check the file parses, not that it matches a specific tree.
In rspec-puppet-augeas test_utils.rb, we have:
raise RSpec::Puppet::Augeas::Error, "augparse failed:\n#{output}" unless res == 0 && output.empty?
But the test that it performs produces output even if it's correct and exits 0.
As you can see, the test passes, but not silently, and so the rspec test fails.
This is in:
augeas-tools 1.0.0-0ubuntu1~raphink1~lucid1
Failure exits 1, that should be enough.