Age | Commit message (Collapse) | Author | Files | Lines |
|
When the 3x to 4x calls take place, resource references in the form
of a PCatalogEntryType are transformed to Puppet::Resource.
Depending on where these (reference) Puppet::Resource instances are
used they need to either be absolute, or not (yes, 3x is inconsistent).
Since future parser in 3.7 (and later 4.0) will not support dynamic
name scoping, the PCatalogEntryType's should in general be absolute.
This commit changes the transformation to make the created
Puppet::Resource (references) absolute (when it is possible).
This also adds more tests
|
|
This makes the examples that test include, require, contain
share the same tests.
This also adds one missing error condition.
|
|
This generalizes the "make names absolute" to a transformation
of given arguments to class names strings suitable for lookup, and
also applying the transformation to Class and Resource reference types.
|
|
After trying to get the manifest and modulepath during the
initialization for an environment, it turned out that a lot of other
things depended on a very specific load order. Some of those needed to
change around, others needed to delay executing until later, after
everything had been loaded and initialized (creation of the root
environment was one of these). The reset of the Parser::Functions also
moved so that it doesn't happen until settings have been initialized.
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
These tests relied on being able to call functions in the incorrect
fashion of not passing an array as the argument. They now call the
function under test correctly.
|
|
Now that the compiler is always required by the scope we can save a few
keystrokes by making the non-optional argument a regular value, not a name
prefixed option.
(...even if I love Objective-C as much as the next developer, having the same
text in every call just to name the argument doesn't make much sense in such
an internal context.)
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
eshamow/tickets/master/7801_include_should_accept_arrays
(#7801) Modify include function to accept arrays
|
|
When an array of classes is passed to the :include function, it
currently attempts to wrap the array in another array, and then pass the
entire array through as a single argument, causing an error. This
commit calls flatten against the array before sending it through,
following the pattern of :realize, and enabling arrays to be passed as
well as comma-separated or individual class values.
|
|
In Ruby 1.9 the Test::Unit library was replaced by MiniTest. This changes
some "esoteric" parts of the code, sadly including the parts of the library we
depend on to confine certain tests to only some systems.
Instead of investing heavily in rebuilding that facility over the new MiniTest
library it makes sense to just check for and either destroy or port the old
tests to the new rspec harness.
This is our desired future - that only one test framework exist - and we might
as well take full advantage of this opportunity to clean up our legacy code.
It also drops tests that duplicate testing already present in the spec suite.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
We now use a shebang of: #!/usr/bin/env rspec
This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
|
|
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we
can just stop. As a side-effect we can now avoid a whole pile of stupid things
to try and include the spec_helper.rb file...
...and then we can stop protecting spec_helper from evaluating twice, since we
now require it with a consistent name. Yay.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
We historically had a state-dependency across tests in the parser function
support area; the first test caused the function to be loaded, and other tests
would then fail as a consequence of that.
We now autoload all functions at the top of each test suite, allowing us to
correctly and sensibly test on them as we should.
This theoretically prevents us from testing the autoloader implicitly in these
tests, but that should be tested independently.
Paired-With: Nick Lewis <nick@puppetlabs.com>
|
|
Doing a require to a relative path can cause files to be required more
than once when they're required from different relative paths. If you
expand the path fully, this won't happen. Ruby 1.9 also requires that
you use expand_path when doing these requires.
Paired-with: Jesse Wolfe
|
|
This test ran into a mocha bug, and was stubbing too much anyway.
It's being moved to an acceptance test.
|
|
The tests introduced with the fix for #4242 have isolation issues apparently
due to the creation of a stage resource which is global and persistent. This
patch stubs the creation, marks the one test which is thus invalidated pending,
and adds comments noting the problem.
|
|
Resources mark themselves as evaluated to prevent being evaluated
again. Unfortunately, they were not marking themselves until after
they had finished being completely evaluated. Thus, there was
nothing actually stopping recursive evaluations. This patch just
makes resources mark themselves as evaluated when they start
evaluating, and adds tests.
The original setting of evaluated was done in an ensure block, so
this doesn't change the behavior of a resource which fails to
evaluate. The only places evaluated? is checked aren't affected
by this change, as they wouldn't want to evaluate it when it's
already being evaluated anyway.
|