summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorRick Bradley <rick@rickbradley.com>2007-10-15 23:33:12 -0500
committerRick Bradley <rick@rickbradley.com>2007-10-15 23:33:12 -0500
commit099c5469bf8fd6bf1e65be1a8192c14e584e49c3 (patch)
tree7c66bec5658d87bdf5f5ea13112b6acec29c3110 /spec
parentb1d62231c587e13ad78fe1bbd292a6c9f1cb99a1 (diff)
downloadpuppet-099c5469bf8fd6bf1e65be1a8192c14e584e49c3.tar.gz
puppet-099c5469bf8fd6bf1e65be1a8192c14e584e49c3.tar.xz
puppet-099c5469bf8fd6bf1e65be1a8192c14e584e49c3.zip
Finish front end of delegation to server+protocol helper classes ("handlers").
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/network/http/mongrel.rb15
-rw-r--r--spec/unit/network/http/webrick.rb14
2 files changed, 29 insertions, 0 deletions
diff --git a/spec/unit/network/http/mongrel.rb b/spec/unit/network/http/mongrel.rb
index 0990a42d0..161080109 100644
--- a/spec/unit/network/http/mongrel.rb
+++ b/spec/unit/network/http/mongrel.rb
@@ -73,6 +73,21 @@ describe Puppet::Network::HTTP::Mongrel, "when turning on listening" do
end
@server.listen(@listen_params)
end
+
+ it "should use a Mongrel + REST class to configure Mongrel when REST services are requested" do
+ Puppet::Network::HTTP::MongrelREST.expects(:new).at_least_once
+ @server.listen(@listen_params.merge(:protocols => [:rest]))
+ end
+
+ it "should use a Mongrel + XMLRPC class to configure Mongrel when XMLRPC services are requested" do
+ Puppet::Network::HTTP::MongrelXMLRPC.expects(:new).at_least_once
+ @server.listen(@listen_params.merge(:protocols => [:xmlrpc]))
+ end
+
+ it "should fail if services from an unknown protocol are requested" do
+ Proc.new { @server.listen(@listen_params.merge(:protocols => [ :foo ]))}.should raise_error(ArgumentError)
+ end
+
end
describe Puppet::Network::HTTP::Mongrel, "when turning off listening" do
diff --git a/spec/unit/network/http/webrick.rb b/spec/unit/network/http/webrick.rb
index 4d914dc76..81b2a0fa9 100644
--- a/spec/unit/network/http/webrick.rb
+++ b/spec/unit/network/http/webrick.rb
@@ -73,6 +73,20 @@ describe Puppet::Network::HTTP::WEBrick, "when turning on listening" do
end
@server.listen(@listen_params)
end
+
+ it "should use a WEBrick + REST class to configure WEBrick when REST services are requested" do
+ Puppet::Network::HTTP::WEBrickREST.expects(:new).at_least_once
+ @server.listen(@listen_params.merge(:protocols => [:rest]))
+ end
+
+ it "should use a WEBrick + XMLRPC class to configure WEBrick when XMLRPC services are requested" do
+ Puppet::Network::HTTP::WEBrickXMLRPC.expects(:new).at_least_once
+ @server.listen(@listen_params.merge(:protocols => [:xmlrpc]))
+ end
+
+ it "should fail if services from an unknown protocol are requested" do
+ Proc.new { @server.listen(@listen_params.merge(:protocols => [ :foo ]))}.should raise_error(ArgumentError)
+ end
end
describe Puppet::Network::HTTP::WEBrick, "when turning off listening" do