mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@875a09e
This commit is contained in:
parent
a06301b103
commit
5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions
|
@ -19,7 +19,7 @@ describe "Net::FTP#connect" do
|
|||
end
|
||||
|
||||
it "tries to connect to the FTP Server on the given host and port" do
|
||||
lambda { @ftp.connect(@server.hostname, @server.server_port) }.should_not raise_error
|
||||
-> { @ftp.connect(@server.hostname, @server.server_port) }.should_not raise_error
|
||||
end
|
||||
|
||||
it "returns nil" do
|
||||
|
@ -28,22 +28,22 @@ describe "Net::FTP#connect" do
|
|||
|
||||
it "prints a small debug line when in debug mode" do
|
||||
@ftp.debug_mode = true
|
||||
lambda { @ftp.connect(@server.hostname, @server.server_port) }.should output(/#{"connect: "}#{@server.hostname}#{", "}#{@server.server_port}#{"\\nget: 220 Dummy FTP Server ready!"}/)
|
||||
-> { @ftp.connect(@server.hostname, @server.server_port) }.should output(/#{"connect: "}#{@server.hostname}#{", "}#{@server.server_port}#{"\\nget: 220 Dummy FTP Server ready!"}/)
|
||||
@ftp.debug_mode = false
|
||||
end
|
||||
|
||||
it "does not raise any error when the response code is 220" do
|
||||
@server.connect_message = "220 Dummy FTP Server ready!"
|
||||
lambda { @ftp.connect(@server.hostname, @server.server_port) }.should_not raise_error
|
||||
-> { @ftp.connect(@server.hostname, @server.server_port) }.should_not raise_error
|
||||
end
|
||||
|
||||
it "raises a Net::FTPReplyError when the response code is 120" do
|
||||
@server.connect_message = "120 Service ready in nnn minutes."
|
||||
lambda { @ftp.connect(@server.hostname, @server.server_port) }.should raise_error(Net::FTPReplyError)
|
||||
-> { @ftp.connect(@server.hostname, @server.server_port) }.should raise_error(Net::FTPReplyError)
|
||||
end
|
||||
|
||||
it "raises a Net::FTPTempError when the response code is 421" do
|
||||
@server.connect_message = "421 Service not available, closing control connection."
|
||||
lambda { @ftp.connect(@server.hostname, @server.server_port) }.should raise_error(Net::FTPTempError)
|
||||
-> { @ftp.connect(@server.hostname, @server.server_port) }.should raise_error(Net::FTPTempError)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue