summaryrefslogtreecommitdiff
path: root/spec/unit/puppet_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune1-1/+1
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,'
2012-08-31Revert "(#15852) Remove version check from puppet_spec.rb"Daniel Pittman1-0/+7
This reverts commit e30d6efbe975d79458a6aac0c52a5854a50cb7ad. There is a better strategy for this, shortly to be flowed through.
2012-08-15(#15852) Remove version check from puppet_spec.rbMatthaus Litteken1-7/+0
This commit removes the version test from puppet, as it doesn't ensure any functionality of puppet, but only that the version string matches certain criteria.
2012-08-14(#15852) Allow rc in Puppet and Facter version stringsMatthaus Litteken1-4/+0
Previously putting rc in the Puppet version string would fail, mainly because of a test that verified that the version only contained 3 dot separated integers. This commit updates the Facter dependency to correctly use 2.0.0-rc as the minimum version, as 2.0.0-rc is less than the previously required 2.0.0 as specified by SemVer. It also removes the test that verified the Puppet version was a 'valid' 3 dotted integer version. That test is redundant, as the test that follows verifies that the version string is valid SemVer.
2012-07-02(maint) Standardize on /usr/bin/env ruby -S rspecJeff McCune1-1/+1
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.
2012-04-18Use platform path separator in tests.Daniel Pittman1-1/+1
When we test path modification, we should use the platform path separator. Makes the test pass on Windows. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port tests of the defaults system from Test::Unit.Daniel Pittman1-0/+11
The only meaningful test was that the Puppet version number was sane. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port Puppet[:libdir] and LOAD_PATH test from Test::UnitDaniel Pittman1-1/+17
This ports over the :libdir setting test, and checks that it adjusts the LOAD_PATH. That, like the previous test, highlights a shared resource that was not being saved or restored in our test suite. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port Puppet[:path] test from Test::Unit to RSpecDaniel Pittman1-0/+6
This test checks that changing the setting results in changing the process environment. Not the most awesome test, but nothing else checks either. It also highlights that we didn't preserve the process environment over tests, which is bad, because that is a shared, persistent resource that will change state in response to test actions. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-04-13maint: clean up the spec test headers in bulk.Daniel Pittman1-1/+1
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.
2011-04-08maint: just require 'spec_helper', thanks rspec2Daniel Pittman1-1/+1
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>
2010-12-06maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson1-1/+1
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
2010-07-09Code smell: Two space indentationMarkus Roberts1-4/+4
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
2010-06-28[#3994-part 3] rename spec tests from *_spec_spec to *_spec.rbMarkus Roberts1-0/+12
Part 2 re-did the change on the spec files, which it shouldn't have.
2010-06-28[#3994-part 2] rename integration tests to *_spec.rbMarkus Roberts1-12/+0
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
2010-06-23[#3994] rename the specs to have _spec.rb at the endMarkus Roberts1-0/+12
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