diff options
author | Rick Bradley <rick@rickbradley.com> | 2007-10-15 23:33:12 -0500 |
---|---|---|
committer | Rick Bradley <rick@rickbradley.com> | 2007-10-15 23:33:12 -0500 |
commit | 099c5469bf8fd6bf1e65be1a8192c14e584e49c3 (patch) | |
tree | 7c66bec5658d87bdf5f5ea13112b6acec29c3110 /spec | |
parent | b1d62231c587e13ad78fe1bbd292a6c9f1cb99a1 (diff) | |
download | puppet-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.rb | 15 | ||||
-rw-r--r-- | spec/unit/network/http/webrick.rb | 14 |
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 |