diff options
| author | Luke Kanies <luke@madstop.com> | 2008-07-29 00:46:11 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-07-29 00:46:11 -0500 |
| commit | 40375a8fc34dbd85d87f507ba72c7394b25b7271 (patch) | |
| tree | efd5a93980b042b73322bd31e6fdb41203d07576 /spec/unit/network/http | |
| parent | 93eeff59d807261ed154cc104e318ae604602430 (diff) | |
| parent | 8f5800f0608dff46407cb5f23ee73f314fe051e8 (diff) | |
| download | puppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.tar.gz puppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.tar.xz puppet-40375a8fc34dbd85d87f507ba72c7394b25b7271.zip | |
Merge branch '0.24.x' into merging
Conflicts:
test/ral/type/filesources.rb
Diffstat (limited to 'spec/unit/network/http')
| -rwxr-xr-x | spec/unit/network/http/mongrel.rb | 10 | ||||
| -rwxr-xr-x | spec/unit/network/http/mongrel/rest.rb | 16 | ||||
| -rwxr-xr-x | spec/unit/network/http/webrick.rb | 1 | ||||
| -rwxr-xr-x | spec/unit/network/http/webrick/rest.rb | 1 |
4 files changed, 23 insertions, 5 deletions
diff --git a/spec/unit/network/http/mongrel.rb b/spec/unit/network/http/mongrel.rb index 1f87fd943..9c708067a 100755 --- a/spec/unit/network/http/mongrel.rb +++ b/spec/unit/network/http/mongrel.rb @@ -6,18 +6,22 @@ require File.dirname(__FILE__) + '/../../../spec_helper' require 'puppet/network/http' -describe Puppet::Network::HTTP::Mongrel, "after initializing" do +describe "Puppet::Network::HTTP::Mongrel", "after initializing" do confine "Mongrel is not available" => Puppet.features.mongrel? it "should not be listening" do + require 'puppet/network/http/mongrel' + Puppet::Network::HTTP::Mongrel.new.should_not be_listening end end -describe Puppet::Network::HTTP::Mongrel, "when turning on listening" do +describe "Puppet::Network::HTTP::Mongrel", "when turning on listening" do confine "Mongrel is not available" => Puppet.features.mongrel? before do + require 'puppet/network/http/mongrel' + @server = Puppet::Network::HTTP::Mongrel.new @mock_mongrel = mock('mongrel') @mock_mongrel.stubs(:run) @@ -109,7 +113,7 @@ describe Puppet::Network::HTTP::Mongrel, "when turning on listening" do end end -describe Puppet::Network::HTTP::Mongrel, "when turning off listening" do +describe "Puppet::Network::HTTP::Mongrel", "when turning off listening" do confine "Mongrel is not available" => Puppet.features.mongrel? before do diff --git a/spec/unit/network/http/mongrel/rest.rb b/spec/unit/network/http/mongrel/rest.rb index 3df925133..de5254a7a 100755 --- a/spec/unit/network/http/mongrel/rest.rb +++ b/spec/unit/network/http/mongrel/rest.rb @@ -3,10 +3,12 @@ require File.dirname(__FILE__) + '/../../../../spec_helper' require 'puppet/network/http' -describe Puppet::Network::HTTP::MongrelREST, "when initializing" do +describe "Puppet::Network::HTTP::MongrelREST", "when initializing" do confine "Mongrel is not available" => Puppet.features.mongrel? before do + require 'puppet/network/http/mongrel/rest' + @mock_mongrel = mock('Mongrel server') @mock_mongrel.stubs(:register) @mock_model = mock('indirected model') @@ -33,7 +35,7 @@ describe Puppet::Network::HTTP::MongrelREST, "when initializing" do end end -describe Puppet::Network::HTTP::MongrelREST, "when receiving a request" do +describe "Puppet::Network::HTTP::MongrelREST", "when receiving a request" do confine "Mongrel is not available" => Puppet.features.mongrel? before do @@ -131,6 +133,8 @@ describe Puppet::Network::HTTP::MongrelREST, "when receiving a request" do end describe "and determining the request parameters", :shared => true do + confine "Mongrel is not available" => Puppet.features.mongrel? + before do @mock_request.stubs(:params).returns({}) end @@ -198,6 +202,8 @@ describe Puppet::Network::HTTP::MongrelREST, "when receiving a request" do end describe "when finding a model instance" do |variable| + confine "Mongrel is not available" => Puppet.features.mongrel? + it "should fail to find model if key is not specified" do @mock_request.stubs(:params).returns({ Mongrel::Const::REQUEST_METHOD => 'GET', Mongrel::Const::REQUEST_PATH => '/foo'}) @mock_response.expects(:start).with(404) @@ -236,6 +242,8 @@ describe Puppet::Network::HTTP::MongrelREST, "when receiving a request" do end describe "when destroying a model instance" do |variable| + confine "Mongrel is not available" => Puppet.features.mongrel? + it "should fail to destroy model if key is not specified" do @mock_request.stubs(:params).returns({ Mongrel::Const::REQUEST_METHOD => 'DELETE', Mongrel::Const::REQUEST_PATH => '/foo'}) @mock_response.expects(:start).with(404) @@ -281,6 +289,8 @@ describe Puppet::Network::HTTP::MongrelREST, "when receiving a request" do end describe "when saving a model instance" do |variable| + confine "Mongrel is not available" => Puppet.features.mongrel? + it "should fail to save model if data is not specified" do @mock_request.stubs(:params).returns({ Mongrel::Const::REQUEST_METHOD => 'PUT', Mongrel::Const::REQUEST_PATH => '/foo'}) @mock_request.stubs(:body).returns('') @@ -319,6 +329,8 @@ describe Puppet::Network::HTTP::MongrelREST, "when receiving a request" do end describe "when searching for model instances" do |variable| + confine "Mongrel is not available" => Puppet.features.mongrel? + it "should use a common method for determining the request parameters" do setup_search_request('QUERY_STRING' => 'foo=baz&bar=xyzzy') @handler.expects(:params).returns(:foo => :baz, :bar => :xyzzy) diff --git a/spec/unit/network/http/webrick.rb b/spec/unit/network/http/webrick.rb index e3c3b81c0..7e5084bbc 100755 --- a/spec/unit/network/http/webrick.rb +++ b/spec/unit/network/http/webrick.rb @@ -5,6 +5,7 @@ require File.dirname(__FILE__) + '/../../../spec_helper' require 'puppet/network/http' +require 'puppet/network/http/webrick' describe Puppet::Network::HTTP::WEBrick, "after initializing" do it "should not be listening" do diff --git a/spec/unit/network/http/webrick/rest.rb b/spec/unit/network/http/webrick/rest.rb index 45e5f0bd2..17d47e54c 100755 --- a/spec/unit/network/http/webrick/rest.rb +++ b/spec/unit/network/http/webrick/rest.rb @@ -2,6 +2,7 @@ require File.dirname(__FILE__) + '/../../../../spec_helper' require 'puppet/network/http' +require 'puppet/network/http/webrick/rest' describe Puppet::Network::HTTP::WEBrickREST, "when initializing" do before do |
