summaryrefslogtreecommitdiff
path: root/spec/unit/hiera/scope_spec.rb
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(#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-09-05Clean up the Hiera Puppet integration.Daniel Pittman1-47/+45
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 Hightower1-0/+64
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.