summaryrefslogtreecommitdiffstats
path: root/spec/unit/network/xmlrpc
Commit message (Collapse)AuthorAgeFilesLines
* maint: clean up the spec test headers in bulk.Daniel Pittman2011-04-131-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.
* maint: just require 'spec_helper', thanks rspec2Daniel Pittman2011-04-081-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>
* maint: Change code for finding spec_helper to work with Ruby 1.9Matt Robinson2011-03-221-1/+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>
* maint: Fix a test that was missing a requireMatt Robinson2010-11-221-0/+1
| | | | Paired-with: Nick Lewis
* Code smell: Two space indentationMarkus Roberts2010-07-091-116/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [#3994-part 3] rename spec tests from *_spec_spec to *_spec.rbMarkus Roberts2010-06-281-0/+0
| | | | Part 2 re-did the change on the spec files, which it shouldn't have.
* [#3994-part 2] rename integration tests to *_spec.rbMarkus Roberts2010-06-281-0/+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
* [#4006] Fix test failures caused by reverting ticket 2890Matt Robinson2010-06-241-1/+1
| | | | | | | | | When Markus reverted changes made by 2890 he reintroduced a method certificate_matches_key? that then caused failures in network/xmlrpc/client.rb. I just stubbed that method to return true since the failing tests weren't trying to test that methods behavior. Reviewed-by: Markus Roberts
* [#3994] rename the specs to have _spec.rb at the endMarkus Roberts2010-06-231-0/+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
* Fixing a test broken by a log demotionLuke Kanies2009-02-141-2/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #961 - closing the http connection after every xmlrpc callLuke Kanies2009-02-121-0/+22
| | | | | | | | There were apparently some circumstances that resulted in the connection not being closed; this just closes it every time if it's still open after the rpc call is complete. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the XMLRPC::Client error-handlingLuke Kanies2009-02-121-7/+143
| | | | | | | | | | | | | | | | | I split it all into smaller, manageable chunks, and used methods for each step, instead of having one huge call. Note that I made all of the tests first, then refactored the code, so I'm confident there's no behavior change. I don't know that this is actually a lot cleaner, but it seems that way to me. I'm open to skipping this, but I think it makes the whole thing a lot cleaner. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing the included testing gems; you must now install them yourself.Luke Kanies2008-11-251-0/+0
| | | | | | Everything passes, but autotest doesn't include color. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #1473 - Rescue Timeout::Error in xmlrpc clientsAndrew Shafer2008-10-071-0/+13
| | | | | Added a rescue block for Timeout::Error (which isn't a subclass of StandardError) Removed a Dev Error conditional to facilitate testing
* Entirely refactoring http keep-alive. There's nowLuke Kanies2007-12-191-107/+0
| | | | | | | | a central module responsible for managing the http pool (Puppet::Network::HttpPool), and it also handles setting certificate information. This gets rid of what were otherwise long chains of method calls, and it makes the code paths much clearer.
* Fixing #961 -- closing existing, open connections whenLuke Kanies2007-12-171-1/+31
| | | | | a new connection is requested, and closing all connections at the end of each run.
* Fixing some further failing tests resulting from the fix forLuke Kanies2007-12-101-13/+11
|
* Updated tests for http_enable_post_connection_check configuration setting.Jeffrey J McCune2007-11-291-0/+10
|
* Fixing a couple of tests that were failing on a different platform or with a ↵Luke Kanies2007-11-281-1/+1
| | | | different version of ruby
* Integrating most of Matt Palmer's fromLuke Kanies2007-11-241-0/+69
http://theshed.hezmatt.org/mattshacks/puppet/_patches/puppet-0.23.2/. There are still a few that haven't made it in, notably those related to the plugins module, which I'm planning on integrating separately.