diff options
| author | Rick Bradley <rick@rickbradley.com> | 2007-10-15 23:04:24 -0500 |
|---|---|---|
| committer | Rick Bradley <rick@rickbradley.com> | 2007-10-15 23:04:24 -0500 |
| commit | b1d62231c587e13ad78fe1bbd292a6c9f1cb99a1 (patch) | |
| tree | d7a93ce3be6b72f43bff152418925eda609bd861 /spec/unit/network/http/webrick.rb | |
| parent | 298eff27a6c702c177fa11e08c980c7365382162 (diff) | |
| download | puppet-b1d62231c587e13ad78fe1bbd292a6c9f1cb99a1.tar.gz puppet-b1d62231c587e13ad78fe1bbd292a6c9f1cb99a1.tar.xz puppet-b1d62231c587e13ad78fe1bbd292a6c9f1cb99a1.zip | |
Bringing in initial handlers for server+protocol pairs.
Diffstat (limited to 'spec/unit/network/http/webrick.rb')
| -rw-r--r-- | spec/unit/network/http/webrick.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/network/http/webrick.rb b/spec/unit/network/http/webrick.rb index b94a6a78d..4d914dc76 100644 --- a/spec/unit/network/http/webrick.rb +++ b/spec/unit/network/http/webrick.rb @@ -60,19 +60,19 @@ describe Puppet::Network::HTTP::WEBrick, "when turning on listening" do @server.should be_listening end - it "should instantiate a specific handler (mongrel+rest, e.g.) for each named handler, for each named protocol)" do - @listen_params[:handlers].each do |handler| - @listen_params[:protocols].each do |protocol| - mock_handler = mock("handler instance for [#{protocol}]+[#{handler}]") - mock_handler_class = mock("handler class for [#{protocol}]+[#{handler}]") - mock_handler_class.expects(:new).returns(mock_handler) - @server.expects(:class_for_protocol_handler).with(protocol, handler).returns(mock_handler_class) + it "should instantiate a handler for each protocol+handler pair to configure web server routing" do + @listen_params[:protocols].each do |protocol| + mock_handler = mock("handler instance for [#{protocol}]") + mock_handler_class = mock("handler class for [#{protocol}]") + @listen_params[:handlers].each do |handler| + mock_handler_class.expects(:new).with {|args| + args[:server] == @mock_webrick and args[:handler] == handler + }.returns(mock_handler) end + @server.expects(:class_for_protocol).with(protocol).at_least_once.returns(mock_handler_class) end - @server.listen(@listen_params) + @server.listen(@listen_params) end - - it "should mount handlers on a webrick path" end describe Puppet::Network::HTTP::WEBrick, "when turning off listening" do |
