summaryrefslogtreecommitdiff
path: root/spec/integration/provider/service/init_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-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-05-31Merge remote-tracking branch 'upstream/2.7rc' into HEADAndrew Parker1-4/+20
* upstream/2.7rc: (#14761) Add boot, reboot to excludes list for redhat provider (maint) Disable upstart spec test on windows (#14615) Final stub fixes for the tests. (#14615) Fix provider spec tests to work on non gentoo systems maint: Make it easier to test the service provider (Maint) Close filehandles after read in upstart Update CHANGELOG, conf/redhat/puppet.spec for 2.7.15rc3 (#14615) Exclude helperscripts in gentoo service provider Conflicts: CHANGELOG conf/redhat/puppet.spec spec/integration/provider/service/init_spec.rb spec/unit/provider/service/init_spec.rb This commit undoes the restriction on the upstart spec that kept it from running on windows. And allowed a freebsd test to begin running on 1.9 series ruby
2012-05-31maint: Make it easier to test the service providerStefan Schulte1-4/+20
Before the change the directories to search for initscripts (e.g. `/etc/init.d`, `/sbin/init.d`) were stored in a class variable that was calculated at load time. This way stubbing `operatingsystem` in test cases did not change the value of `@defpath`. Turning the class variable in a class method. This way stubbing operatingsystem does change the result when querying defpath. The fact lookup should be relativly cheap so we do not have to cache the value in a class variable.
2012-03-30Remove the "fails_on_ruby_1.9.2" tag from tests...Daniel Pittman1-1/+1
Now we have passing tests on Ruby 1.9, we can make all those tags go away and enable the full suite. Now anything that fails should be treated like a real failure, which is reasonable since this is a real and supported platform. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-11-23Fix description in service provider test for FreeBSDKoen Wilde1-1/+1
2011-11-23(#6697) Set service provider default path to /etc/rc.d on ArchlinuxKoen Wilde1-1/+7
2011-05-17(#7507) Add ability to filter Ruby 1.9 spec failuresMatt Robinson1-2/+2
By running: rspec spec --tag ~@fails_on_ruby_1.9.2 We can now just run the specs that pass under Ruby 1.9. Obviously in the long term we want to have all the specs passing, but until then we need notification when we regress. From now on new code will be required to pass under Ruby 1.9, and Jenkins will give us email notification if it doesn't or if we break something that was already working. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
2011-04-13maint: clean up the spec test headers in bulk.Daniel Pittman1-2/+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>
2011-03-22maint: Change code for finding spec_helper to work with Ruby 1.9Matt Robinson1-2/+1
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>
2011-01-04(#5771) Upgrade rspec to version 2Matt Robinson1-9/+3
The biggest change is that we no longer need to monkey patch rspec to get confine behavior. Describe blocks can now be conditional like confine used to be. "describe" blocks with "shared => true" are now "shared_examples_for". Paired-With: Nick Lewis
2010-07-09Code smell: Two space indentationMarkus Roberts1-15/+15
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 2] rename integration tests to *_spec.rbMarkus Roberts1-0/+32
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