Age | Commit message (Collapse) | Author | Files | Lines |
|
Testing that the function exists isn't really needed since the later
tests that actually use the function will find that fairly quickly.
|
|
This modifies the file() function to accept module paths (like the
template() function) as well as fully qualified paths.
This makes it possible for modules that use the file() function
to be more portable, instead of being tied to a specific puppet
server configuration.
Example
with directory structure:
/etc/puppet/modules/example
├── files
│ └──file.ext
├── manifests
│ └──init.pp
└── templates
└──template.erb
When the module path for files can be used instead of the absolute
path:
file('example/file.ext') returns the same as
file('/etc/puppet/modules/example/files/file.ext').
This is supposed to be like how template does module paths, where:
template('example/template.erb') returns the same as
template('/etc/puppet/modules/example/templates/template.erb')
|
|
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>
|
|
The scope object contained some internal code to substitute an external
environment when the compiler was not supplied. This was used only in
testing, not in any production capacity.
In light of that, we can eliminate the dynamic decision making inside the
scope and simply demand that a compiler instance (or a fake equivalent) is
always supplied.
This reduces the complexity of the code and makes clearer the object
relationships involved.
(The small cost is a lot of testing that depended on this had to change to use
a real compiler. Most of the change derives from that.)
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.
|
|
When this test was changed the path became relative on Windows, because it
doesn't have a drive letter. This fixes that with `make_absolute`.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
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>
|