summaryrefslogtreecommitdiffstats
path: root/spec/unit/network
diff options
context:
space:
mode:
authorIan Taylor <ian@lorf.org>2009-06-05 12:39:04 -0400
committerJames Turnbull <james@lovedthanlost.net>2009-06-06 09:12:00 +1000
commit4f2c066a97e59a89df64af4b25beac6f3f0553c2 (patch)
tree126540beec3c65448e01e1b48d27275ec4ee6ea4 /spec/unit/network
parent97e6975d69f239e24993315a25a3117b1daa48c3 (diff)
downloadpuppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.tar.gz
puppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.tar.xz
puppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.zip
Removed extra whitespace from end of lines
Diffstat (limited to 'spec/unit/network')
-rw-r--r--spec/unit/network/handler/fileserver.rb2
-rwxr-xr-xspec/unit/network/http.rb6
-rwxr-xr-xspec/unit/network/http/handler.rb2
-rwxr-xr-xspec/unit/network/http/mongrel.rb30
-rwxr-xr-xspec/unit/network/http/webrick.rb10
-rwxr-xr-xspec/unit/network/rights.rb4
-rwxr-xr-xspec/unit/network/server.rb22
7 files changed, 38 insertions, 38 deletions
diff --git a/spec/unit/network/handler/fileserver.rb b/spec/unit/network/handler/fileserver.rb
index 386e77693..fbb5c8ae2 100644
--- a/spec/unit/network/handler/fileserver.rb
+++ b/spec/unit/network/handler/fileserver.rb
@@ -157,7 +157,7 @@ describe Puppet::Network::Handler::FileServer do
it "should list a file within a directory when given the file path with recursion" do
@mount.list("facter/fact.rb", true, "false").should == [["/", "file"], ["/", "file"]]
end
-
+
it "should return a merged view of all plugins for all modules" do
list = @mount.list("facter",true,false)
list.should == [["/", "directory"], ["/fact.rb", "file"], ["/", "directory"], ["/fact.rb", "file"]]
diff --git a/spec/unit/network/http.rb b/spec/unit/network/http.rb
index 1fa025b0b..220726788 100755
--- a/spec/unit/network/http.rb
+++ b/spec/unit/network/http.rb
@@ -11,7 +11,7 @@ describe Puppet::Network::HTTP do
it "should return the webrick HTTP server class when asked for a webrick server" do
Puppet::Network::HTTP.server_class_by_type(:webrick).should be(Puppet::Network::HTTP::WEBrick)
end
-
+
describe "when asked for a mongrel server" do
if Puppet.features.mongrel?
it "should return the mongrel server class" do
@@ -23,12 +23,12 @@ describe Puppet::Network::HTTP do
end
end
end
-
+
it "should fail to return the mongrel HTTP server class if mongrel is not available " do
Puppet.features.expects(:mongrel?).returns(false)
Proc.new { Puppet::Network::HTTP.server_class_by_type(:mongrel) }.should raise_error(ArgumentError)
end
-
+
it "should return an error when asked for an unknown server" do
Proc.new { Puppet::Network::HTTP.server_class_by_type :foo }.should raise_error(ArgumentError)
end
diff --git a/spec/unit/network/http/handler.rb b/spec/unit/network/http/handler.rb
index 1d10447af..8ef6e00d1 100755
--- a/spec/unit/network/http/handler.rb
+++ b/spec/unit/network/http/handler.rb
@@ -12,7 +12,7 @@ describe Puppet::Network::HTTP::Handler do
before do
@handler = HttpHandled.new
end
-
+
it "should include the v1 REST API" do
Puppet::Network::HTTP::Handler.ancestors.should be_include(Puppet::Network::HTTP::API::V1)
end
diff --git a/spec/unit/network/http/mongrel.rb b/spec/unit/network/http/mongrel.rb
index 59f893251..c0ca68e43 100755
--- a/spec/unit/network/http/mongrel.rb
+++ b/spec/unit/network/http/mongrel.rb
@@ -8,7 +8,7 @@ require 'puppet/network/http'
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'
@@ -33,34 +33,34 @@ describe "Puppet::Network::HTTP::Mongrel", "when turning on listening" do
@listen_params = { :address => "127.0.0.1", :port => 31337, :protocols => [ :rest, :xmlrpc ], :xmlrpc_handlers => [ :status, :fileserver ] }
end
-
+
it "should fail if already listening" do
@server.listen(@listen_params)
Proc.new { @server.listen(@listen_params) }.should raise_error(RuntimeError)
end
-
+
it "should require at least one protocol" do
Proc.new { @server.listen(@listen_params.delete_if {|k,v| :protocols == k}) }.should raise_error(ArgumentError)
end
-
+
it "should require a listening address to be specified" do
Proc.new { @server.listen(@listen_params.delete_if {|k,v| :address == k})}.should raise_error(ArgumentError)
end
-
+
it "should require a listening port to be specified" do
Proc.new { @server.listen(@listen_params.delete_if {|k,v| :port == k})}.should raise_error(ArgumentError)
end
-
+
it "should order a mongrel server to start" do
@mock_mongrel.expects(:run)
@server.listen(@listen_params)
end
-
+
it "should tell mongrel to listen on the specified address and port" do
Mongrel::HttpServer.expects(:new).with("127.0.0.1", 31337).returns(@mock_mongrel)
@server.listen(@listen_params)
end
-
+
it "should be listening" do
Mongrel::HttpServer.expects(:new).returns(@mock_mongrel)
@server.listen(@listen_params)
@@ -72,9 +72,9 @@ describe "Puppet::Network::HTTP::Mongrel", "when turning on listening" do
Puppet::Network::HTTP::MongrelREST.expects(:new).returns "myhandler"
@mock_mongrel.expects(:register).with("/", "myhandler")
- @server.listen(@listen_params)
+ @server.listen(@listen_params)
end
-
+
it "should use a Mongrel + REST class to configure Mongrel when REST services are requested" do
@server.expects(:class_for_protocol).with(:rest).at_least_once.returns(Puppet::Network::HTTP::MongrelREST)
@server.listen(@listen_params)
@@ -102,26 +102,26 @@ end
describe "Puppet::Network::HTTP::Mongrel", "when turning off listening" do
confine "Mongrel is not available" => Puppet.features.mongrel?
-
+
before do
@mock_mongrel = mock('mongrel httpserver')
@mock_mongrel.stubs(:run)
@mock_mongrel.stubs(:register)
Mongrel::HttpServer.stubs(:new).returns(@mock_mongrel)
- @server = Puppet::Network::HTTP::Mongrel.new
+ @server = Puppet::Network::HTTP::Mongrel.new
@listen_params = { :address => "127.0.0.1", :port => 31337, :handlers => [ :node, :catalog ], :protocols => [ :rest ] }
end
-
+
it "should fail unless listening" do
Proc.new { @server.unlisten }.should raise_error(RuntimeError)
end
-
+
it "should order mongrel server to stop" do
@server.listen(@listen_params)
@mock_mongrel.expects(:stop)
@server.unlisten
end
-
+
it "should not be listening" do
@server.listen(@listen_params)
@mock_mongrel.stubs(:stop)
diff --git a/spec/unit/network/http/webrick.rb b/spec/unit/network/http/webrick.rb
index a6fbfc83f..d0c4b5562 100755
--- a/spec/unit/network/http/webrick.rb
+++ b/spec/unit/network/http/webrick.rb
@@ -16,7 +16,7 @@ end
describe Puppet::Network::HTTP::WEBrick, "when turning on listening" do
before do
@mock_webrick = stub('webrick', :[] => {})
- [:mount, :start, :shutdown].each {|meth| @mock_webrick.stubs(meth)}
+ [:mount, :start, :shutdown].each {|meth| @mock_webrick.stubs(meth)}
WEBrick::HTTPServer.stubs(:new).returns(@mock_webrick)
@server = Puppet::Network::HTTP::WEBrick.new
[:setup_logger, :setup_ssl].each {|meth| @server.stubs(meth).returns({})} # the empty hash is required because of how we're merging
@@ -37,7 +37,7 @@ describe Puppet::Network::HTTP::WEBrick, "when turning on listening" do
end
it "should require a listening port to be specified" do
- Proc.new { @server.listen(@listen_params.delete_if {|k,v| :port == k})}.should raise_error(ArgumentError)
+ Proc.new { @server.listen(@listen_params.delete_if {|k,v| :port == k})}.should raise_error(ArgumentError)
end
it "should order a webrick server to start" do
@@ -146,7 +146,7 @@ describe Puppet::Network::HTTP::WEBrick, "when looking up the class to handle a
end
it "should accept a protocol" do
- lambda { Puppet::Network::HTTP::WEBrick.class_for_protocol("bob") }.should_not raise_error(ArgumentError)
+ lambda { Puppet::Network::HTTP::WEBrick.class_for_protocol("bob") }.should_not raise_error(ArgumentError)
end
it "should use a WEBrick + REST class when a REST protocol is specified" do
@@ -163,7 +163,7 @@ describe Puppet::Network::HTTP::WEBrick, "when turning off listening" do
@mock_webrick = stub('webrick', :[] => {})
[:mount, :start, :shutdown].each {|meth| @mock_webrick.stubs(meth)}
WEBrick::HTTPServer.stubs(:new).returns(@mock_webrick)
- @server = Puppet::Network::HTTP::WEBrick.new
+ @server = Puppet::Network::HTTP::WEBrick.new
[:setup_logger, :setup_ssl].each {|meth| @server.stubs(meth).returns({})} # the empty hash is required because of how we're merging
@listen_params = { :address => "127.0.0.1", :port => 31337, :handlers => [ :node, :catalog ], :protocols => [ :rest ] }
end
@@ -188,7 +188,7 @@ end
describe Puppet::Network::HTTP::WEBrick do
before do
@mock_webrick = stub('webrick', :[] => {})
- [:mount, :start, :shutdown].each {|meth| @mock_webrick.stubs(meth)}
+ [:mount, :start, :shutdown].each {|meth| @mock_webrick.stubs(meth)}
WEBrick::HTTPServer.stubs(:new).returns(@mock_webrick)
@server = Puppet::Network::HTTP::WEBrick.new
end
diff --git a/spec/unit/network/rights.rb b/spec/unit/network/rights.rb
index 8a86c8c34..244fa18c8 100755
--- a/spec/unit/network/rights.rb
+++ b/spec/unit/network/rights.rb
@@ -508,9 +508,9 @@ describe Puppet::Network::Rights do
# mocha doesn't allow testing super...
# it "should delegate to the AuthStore for the result" do
# @acl.method(:save)
- #
+ #
# @acl.expects(:allowed?).with("me","127.0.0.1")
- #
+ #
# @acl.allowed?("me","127.0.0.1", :save)
# end
end
diff --git a/spec/unit/network/server.rb b/spec/unit/network/server.rb
index 081848d85..2aeb99a8b 100755
--- a/spec/unit/network/server.rb
+++ b/spec/unit/network/server.rb
@@ -68,7 +68,7 @@ describe Puppet::Network::Server do
it "should fail to initialize if no listening port can be found" do
Puppet.settings.stubs(:value).with(:bindaddress).returns("127.0.0.1")
Puppet.settings.stubs(:value).with(:masterport).returns(nil)
- lambda { Puppet::Network::Server.new }.should raise_error(ArgumentError)
+ lambda { Puppet::Network::Server.new }.should raise_error(ArgumentError)
end
it "should use the Puppet configurator to determine which HTTP server will be used to provide access to clients" do
@@ -164,7 +164,7 @@ describe Puppet::Network::Server do
sync = mock 'sync'
Puppet::Util.expects(:sync).with("me").returns sync
-
+
sync.expects(:synchronize).with(Sync::EX)
@server.create_pidfile
end
@@ -201,7 +201,7 @@ describe Puppet::Network::Server do
sync = mock 'sync'
Puppet::Util.expects(:sync).with("me").returns sync
-
+
sync.expects(:synchronize).with(Sync::EX)
@server.remove_pidfile
end
@@ -265,7 +265,7 @@ describe Puppet::Network::Server do
it "should allow the use of indirection names to specify which indirections are to be no longer accessible to clients" do
@server.register(:foo)
- lambda { @server.unregister(:foo) }.should_not raise_error
+ lambda { @server.unregister(:foo) }.should_not raise_error
end
it "should leave other indirections accessible to clients when turning off indirections" do
@@ -292,7 +292,7 @@ describe Puppet::Network::Server do
it "should disable client access immediately when turning off indirections" do
@server.register(:foo, :bar)
- @server.unregister(:foo)
+ @server.unregister(:foo)
lambda { @server.unregister(:foo) }.should raise_error(ArgumentError)
end
@@ -339,7 +339,7 @@ describe Puppet::Network::Server do
@server2.unregister(:foo, :xyzzy)
lambda { @server.unregister(:xyzzy) }.should raise_error(ArgumentError)
lambda { @server2.unregister(:bar) }.should raise_error(ArgumentError)
- end
+ end
describe "when managing xmlrpc registrations" do
before do
@@ -392,7 +392,7 @@ describe Puppet::Network::Server do
it "should disable client access immediately when turning off namespaces" do
@server.register_xmlrpc(:foo, :bar)
- @server.unregister_xmlrpc(:foo)
+ @server.unregister_xmlrpc(:foo)
lambda { @server.unregister_xmlrpc(:foo) }.should raise_error(ArgumentError)
end
@@ -414,7 +414,7 @@ describe Puppet::Network::Server do
it "should indicate that it is not listening" do
@server.should_not be_listening
- end
+ end
it "should not allow listening to be turned off" do
lambda { @server.unlisten }.should raise_error(RuntimeError)
@@ -461,7 +461,7 @@ describe Puppet::Network::Server do
it "should fetch an instance of an HTTP server" do
@server.stubs(:http_server_class).returns(@mock_http_server_class)
@mock_http_server_class.expects(:new).returns(@mock_http_server)
- @server.listen
+ @server.listen
end
it "should cause the HTTP server to listen" do
@@ -507,7 +507,7 @@ describe Puppet::Network::Server do
@mock_http_server.expects(:listen).with do |args|
args[:protocols] == [ :rest, :xmlrpc ]
end
- @server.listen
+ @server.listen
end
end
@@ -528,7 +528,7 @@ describe Puppet::Network::Server do
Puppet::Indirector::Indirection.stubs(:model).returns mock('indirection')
@server.register(:foo)
- lambda { @server.unregister(:foo) }.should raise_error(RuntimeError)
+ lambda { @server.unregister(:foo) }.should raise_error(RuntimeError)
end
end
end