Age | Commit message (Collapse) | Author | Files | Lines |
|
- Previously tests were writing to the shared
%ALLUSERSPROFILE%\PuppetLabs\puppet directory, and would blow
up if this directory did not exist
- Because this directory was shared from one run to the next, failing
tests could be masked by data generated / used by a locally installed
Puppet
- The stubbing of FileSystem::File.exist? to return true was causing
some tests to treat files like c:\dev\null\foo to attempt to be
loaded, which would cause these tests to fail in isolation, but not
when run within the suite
- Had to change some doc specs under Ruby 1.9 / OSX to verify a value
instead of asserting a method was called, to prevent a stack overflow
- In some unit tests, the process of reading / writing settings caused
issues with test loading, so Puppet.settings.use has been stubbed
|
|
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,'
|
|
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>
|
|
Running the specs under Ruby 1.9 didn't work using the lambda to recurse
down directories to find the spec_helper. Standardizing the way to find
spec_helper like the rest of specs seemed like the way to go.
Here's the command line perl I used to make the change:
perl -p -i -e "s/Dir.chdir.*lambda.*spec_helper.*$/require
File.expand_path(File.dirname(__FILE__) + '\/..\/..\/spec_helper')/"
`find spec -name "*_spec.rb"`
Then I fixed the number of dots for files that weren't two levels from
the spec dir and whose tests failed.
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
|
|
The code made assumptions about report structure that weren't valid for
2.6.x. The change has been verified to work with 0.25.x and 2.6.x
report formats.
Paired with: Rein Henrichs
|