Age | Commit message (Collapse) | Author | Files | Lines |
|
An attempt to collect classes led to an error message that said
that 'class' is not a known resource type (in a way that can be
misinterpreted).
This commit make the error message specific, and clear.
|
|
This test had a flaw in it before where if the collection was not even
done, the test would still pass. In order to check that collection
applies to realized resources the resources need to be changed. This
adds an override so that we can see the effect of the collection
expression on realized resources.
|
|
Test cases added that test that the current implementation does
not regress from its current behavior.
Regular resources are collected. Collection with override can be
done multiple times. Changing and amedning values work for
regular resources as well as virtual.
|
|
The +> form of collection hadn't been covered in any test cases that I
could find. This adds some coverage.
|
|
The tags and array handling of collection queries is "special". This
adds some test coverage around that behavior.
|
|
The virtual resource collection uses the comparator for include?, but a
previous commit changed the signature. This wasn't caught until the
acceptance tests ran because it turns out that the collection tests were
not being run against the future parser.
This fixes the problem by passing the scope that is available for
collection to the method. It also removes two of the acceptance tests in
favor of adding a new integration test and running the collection tests
with the future parser.
|
|
This cleans up source formatting (spaces/tabs), dead todo, blank lines,
ending without a linebreak, and corrects indentation.
|
|
This adds a test for the issue reported and fixed in a8aef51. It turns
out that the problem only manifests when the collect is done inside a
`class` or `define`. This test has been verified to fail without the
patch.
|
|
The previous tests did very little to inform anyone what the behavior of
the collector was expected to be in various situations. This changes the
tests to be individually split out, named, and transformed into
manifests that use the feature.
|
|
The previous layout was very compact and did not make the parts very
clear. This simply reformats it some to make the different parts a
little clearer.
|
|
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,'
|
|
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.
|
|
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>
|
|
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
|
|
definitions (classes, definitions, and nodes).
Previously, type definitions were not represented directly in the AST.
Instead, the parser would instantiate types and insert them into
known_resource_types as soon as they were parsed. This made it
difficult to distinguish which types had come from the file that was
just parsed and which types had been loaded previously, which led to
bug 4496.
A side-effect of this change is that the user is no longer allowed to
define types inside of conditional constructs (such as if/else). This
was allowed before but had unexpected semantics (bugs 4521 and 4522).
It is still possible, however, to place an "include" statement inside
a conditional construct, and have that "include" statement trigger the
autoloading of a file that instantiates types.
|
|
Replaced 106806 occurances of ^( +)(.*$) with
The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people
who learned ruby in the 1900s) uses two-space indentation.
3 Examples:
The code:
end
# Tell getopt which arguments are valid
def test_get_getopt_args
element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new
assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")
becomes:
end
# Tell getopt which arguments are valid
def test_get_getopt_args
element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new
assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")
The code:
assert_equal(str, val)
assert_instance_of(Float, result)
end
# Now test it with a passed object
becomes:
assert_equal(str, val)
assert_instance_of(Float, result)
end
# Now test it with a passed object
The code:
end
assert_nothing_raised do
klass[:Yay] = "boo"
klass["Cool"] = :yayness
end
becomes:
end
assert_nothing_raised do
klass[:Yay] = "boo"
klass["Cool"] = :yayness
end
|
|
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
|