Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
|
|
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.
|
|
This adds a test around the fix to treat a false value in a hierarchy as
a real value.
|
|
The hiera puppet backend called the include function without passing the
argument as an array. This changes it to call the function correctly.
|
|
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>
|
|
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.
|