summaryrefslogtreecommitdiff
path: root/spec/unit/hiera
AgeCommit message (Collapse)AuthorFilesLines
2013-12-05(maint) Cleanup Scope impl from unused methods & test specific codeHenrik Lindberg1-2/+6
This removes several unused methods and attributes from Puppet::Parser::Scope. The only places in code using them where tests. It also removes some "convenience"/"proxy" methods used by only the Collector (better for it to do this on its own than cluttering the Scope implementation) Also refactors creating scopes for the purpose of running tests by moving that logic from Scope to PuppetSpec::Scope that should be included in examples to use the no(now renamed) method Useless and tests that test that scope behaves the wrong ! way removed. (It is always illegal to set match data variables from anything but a match, but this functionality was tested by spec tests). It was then much clearer how match scope and local scope should work. Now a LocalScope always have a nested MatchScope that is transparent until a match is set, or a nested MatchScope is created for an inner scope. This enables rewriting the evaluator logic to not leak match scopes where there is a sequence of matches at top level in a define or class body.
2013-04-05(#14985) Alias module_name as calling_moduleAndrew Parker1-25/+2
The new implementation of calling_module turned out to be the same as puppet's own module_name. This makes it simply and alias so that we keep that as the definition of calling_module.
2013-02-25(#14985) Preserve casing on looked up valuesAndrew Parker1-1/+23
The initial fix for looked up values downcased everything that was being returned. This causes problems when the data is not a string that the previous behavior was to only do this for the calling_class and calling_module. This commit us returns to that behavior.
2013-02-25(#14985) Describe behavior of calling_(class|module)Andrew Parker1-9/+40
The original tests for calling_module and calling_class used a mock, when this is really just a value that can be setup. It also didn't separate out and describe the behavior of the two pieces in the variations in which they can come up. Specifically the difference between a `define` and a `class` for the meaning of calling_class.
2013-02-25(Maint) Use real scope in testingAndrew Parker1-22/+6
Using the real scope is completely possible in these tests since it has no dependencies on the outside world and is essentially a value object. Therefore it should be used in the tests to make them more comprehensive.
2013-02-25(Maint) Require Hiera::Config to avoid warningAndrew Parker1-0/+1
When the hiera tests were run alone the puppet_backend_spec.rb issued a warning: /Users/andy/work/puppet/spec/unit/hiera/backend/puppet_backend_spec.rb:25: warning: toplevel constant Config referenced by Hiera::Config The warning was caused by a reference to Hiera::Config where Hiera was defined, but Hiera::Config was not. This resulted in getting the top level Config constant and a warning being issued. By requiring hiera/config this problem is avoided.
2013-02-25(#14985) Fix exception when nil is returned from inner scopeAvishai Ish-Shalom1-0/+8
2013-02-25(#14985) Fix test, return downcase values and check for nil scope.sourceAvishai Ish-Shalom1-5/+6
2012-11-15(Maint) Remove duplication and mocking from testsAndrew Parker1-45/+39
The tests used to have a large amount of duplication around setting configuration values for Hiera, this extracts them into a common spot and also removes some of the mocking that was being done in order to make the tests a little more straightforward and less tied to the implementation.
2012-11-15(#16178) Add test for behavior of false values in lookupAndrew Parker1-2/+15
This adds a test around the fix to treat a false value in a hierarchy as a real value.
2012-09-11(#15756) Call include function correctlyAndrew Parker1-1/+1
The hiera puppet backend called the include function without passing the argument as an array. This changes it to call the function correctly.
2012-09-05Clean up the Hiera Puppet integration.Daniel Pittman2-170/+165
This updates the tests to work correctly in the Puppet environment, rather than running as part of a separate repository and package. It also moves the examples into a more appropriate location. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-06-23(#15184) Refactor parser functionsKelsey Hightower2-0/+207
This patch refactors the parser functions which centralizes hiera configuration and lookups into a new `HieraPuppet` module. The spec tests have be reorganized into a better hierarchy. Updated specs and acceptance tests are included.