diff options
Diffstat (limited to 'spec/ruby/library/net')
46 files changed, 257 insertions, 257 deletions
diff --git a/spec/ruby/library/net/ftp/abort_spec.rb b/spec/ruby/library/net/ftp/abort_spec.rb index ff2144a3a0..57651468d8 100644 --- a/spec/ruby/library/net/ftp/abort_spec.rb +++ b/spec/ruby/library/net/ftp/abort_spec.rb @@ -18,7 +18,7 @@ describe "Net::FTP#abort" do end it "sends the ABOR command to the server" do - lambda { @ftp.abort }.should_not raise_error + -> { @ftp.abort }.should_not raise_error end it "ignores the response" do @@ -32,31 +32,31 @@ describe "Net::FTP#abort" do it "does not raise any error when the response code is 225" do @server.should_receive(:abor).and_respond("225 Data connection open; no transfer in progress.") - lambda { @ftp.abort }.should_not raise_error + -> { @ftp.abort }.should_not raise_error end it "does not raise any error when the response code is 226" do @server.should_receive(:abor).and_respond("226 Closing data connection.") - lambda { @ftp.abort }.should_not raise_error + -> { @ftp.abort }.should_not raise_error end it "raises a Net::FTPProtoError when the response code is 500" do @server.should_receive(:abor).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.abort }.should raise_error(Net::FTPProtoError) + -> { @ftp.abort }.should raise_error(Net::FTPProtoError) end it "raises a Net::FTPProtoError when the response code is 501" do @server.should_receive(:abor).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.abort }.should raise_error(Net::FTPProtoError) + -> { @ftp.abort }.should raise_error(Net::FTPProtoError) end it "raises a Net::FTPProtoError when the response code is 502" do @server.should_receive(:abor).and_respond("502 Command not implemented.") - lambda { @ftp.abort }.should raise_error(Net::FTPProtoError) + -> { @ftp.abort }.should raise_error(Net::FTPProtoError) end it "raises a Net::FTPProtoError when the response code is 421" do @server.should_receive(:abor).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.abort }.should raise_error(Net::FTPProtoError) + -> { @ftp.abort }.should raise_error(Net::FTPProtoError) end end diff --git a/spec/ruby/library/net/ftp/acct_spec.rb b/spec/ruby/library/net/ftp/acct_spec.rb index 3db51fca0f..d8068dc81e 100644 --- a/spec/ruby/library/net/ftp/acct_spec.rb +++ b/spec/ruby/library/net/ftp/acct_spec.rb @@ -28,31 +28,31 @@ describe "Net::FTP#acct" do it "does not raise any error when the response code is 230" do @server.should_receive(:acct).and_respond("230 User logged in, proceed.") - lambda { @ftp.acct("my_account") }.should_not raise_error + -> { @ftp.acct("my_account") }.should_not raise_error end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:acct).and_respond("530 Not logged in.") - lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError) + -> { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:acct).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError) + -> { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:acct).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError) + -> { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 503" do @server.should_receive(:acct).and_respond("503 Bad sequence of commands.") - lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError) + -> { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:acct).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPTempError) + -> { @ftp.acct("my_account") }.should raise_error(Net::FTPTempError) end end diff --git a/spec/ruby/library/net/ftp/chdir_spec.rb b/spec/ruby/library/net/ftp/chdir_spec.rb index 1f558c47e8..4c10fa78b4 100644 --- a/spec/ruby/library/net/ftp/chdir_spec.rb +++ b/spec/ruby/library/net/ftp/chdir_spec.rb @@ -29,32 +29,32 @@ describe "Net::FTP#chdir" do it "does not raise a Net::FTPPermError when the response code is 500" do @server.should_receive(:cdup).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.chdir("..") }.should_not raise_error(Net::FTPPermError) + -> { @ftp.chdir("..") }.should_not raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:cdup).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.chdir("..") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("..") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:cdup).and_respond("502 Command not implemented.") - lambda { @ftp.chdir("..") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("..") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:cdup).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.chdir("..") }.should raise_error(Net::FTPTempError) + -> { @ftp.chdir("..") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:cdup).and_respond("530 Not logged in.") - lambda { @ftp.chdir("..") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("..") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:cdup).and_respond("550 Requested action not taken.") - lambda { @ftp.chdir("..") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("..") }.should raise_error(Net::FTPPermError) end end @@ -69,31 +69,31 @@ describe "Net::FTP#chdir" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:cwd).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:cwd).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:cwd).and_respond("502 Command not implemented.") - lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:cwd).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.chdir("test") }.should raise_error(Net::FTPTempError) + -> { @ftp.chdir("test") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:cwd).and_respond("530 Not logged in.") - lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:cwd).and_respond("550 Requested action not taken.") - lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) + -> { @ftp.chdir("test") }.should raise_error(Net::FTPPermError) end end diff --git a/spec/ruby/library/net/ftp/connect_spec.rb b/spec/ruby/library/net/ftp/connect_spec.rb index 981751233e..9ee9bcd2c6 100644 --- a/spec/ruby/library/net/ftp/connect_spec.rb +++ b/spec/ruby/library/net/ftp/connect_spec.rb @@ -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 diff --git a/spec/ruby/library/net/ftp/delete_spec.rb b/spec/ruby/library/net/ftp/delete_spec.rb index fa0eddb312..cf8f9332e2 100644 --- a/spec/ruby/library/net/ftp/delete_spec.rb +++ b/spec/ruby/library/net/ftp/delete_spec.rb @@ -24,36 +24,36 @@ describe "Net::FTP#delete" do it "raises a Net::FTPTempError when the response code is 450" do @server.should_receive(:dele).and_respond("450 Requested file action not taken.") - lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPTempError) + -> { @ftp.delete("test.file") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:dele).and_respond("550 Requested action not taken.") - lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:dele).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:dele).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:dele).and_respond("502 Command not implemented.") - lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:dele).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPTempError) + -> { @ftp.delete("test.file") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:dele).and_respond("530 Not logged in.") - lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError) end end diff --git a/spec/ruby/library/net/ftp/fixtures/server.rb b/spec/ruby/library/net/ftp/fixtures/server.rb index 65339cfaf9..d4795a5c58 100644 --- a/spec/ruby/library/net/ftp/fixtures/server.rb +++ b/spec/ruby/library/net/ftp/fixtures/server.rb @@ -86,7 +86,7 @@ module NetFTPSpecs end def and_respond(text) - @handlers[@handler_for] = lambda { |s, *args| s.response(text) } + @handlers[@handler_for] = -> s, *args { s.response(text) } end ## diff --git a/spec/ruby/library/net/ftp/help_spec.rb b/spec/ruby/library/net/ftp/help_spec.rb index c7a089a588..d2e9fe7ee8 100644 --- a/spec/ruby/library/net/ftp/help_spec.rb +++ b/spec/ruby/library/net/ftp/help_spec.rb @@ -36,31 +36,31 @@ describe "Net::FTP#help" do it "does not raise any error when the response code is 211" do @server.should_receive(:help).and_respond("211 System status, or system help reply.") - lambda { @ftp.help }.should_not raise_error + -> { @ftp.help }.should_not raise_error end it "does not raise any error when the response code is 214" do @server.should_receive(:help).and_respond("214 Help message.") - lambda { @ftp.help }.should_not raise_error + -> { @ftp.help }.should_not raise_error end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:help).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.help }.should raise_error(Net::FTPPermError) + -> { @ftp.help }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:help).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.help }.should raise_error(Net::FTPPermError) + -> { @ftp.help }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:help).and_respond("502 Command not implemented.") - lambda { @ftp.help }.should raise_error(Net::FTPPermError) + -> { @ftp.help }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:help).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.help }.should raise_error(Net::FTPTempError) + -> { @ftp.help }.should raise_error(Net::FTPTempError) end end diff --git a/spec/ruby/library/net/ftp/login_spec.rb b/spec/ruby/library/net/ftp/login_spec.rb index c4f14f8747..46736851ee 100644 --- a/spec/ruby/library/net/ftp/login_spec.rb +++ b/spec/ruby/library/net/ftp/login_spec.rb @@ -32,7 +32,7 @@ describe "Net::FTP#login" do it "raises a Net::FTPReplyError when the server requests an account" do @server.should_receive(:user).and_respond("331 User name okay, need password.") @server.should_receive(:pass).and_respond("332 Need account for login.") - lambda { @ftp.login }.should raise_error(Net::FTPReplyError) + -> { @ftp.login }.should raise_error(Net::FTPReplyError) end end @@ -44,13 +44,13 @@ describe "Net::FTP#login" do it "raises a Net::FTPReplyError when the server requests a password, but none was given" do @server.should_receive(:user).and_respond("331 User name okay, need password.") - lambda { @ftp.login("rubyspec") }.should raise_error(Net::FTPReplyError) + -> { @ftp.login("rubyspec") }.should raise_error(Net::FTPReplyError) end it "raises a Net::FTPReplyError when the server requests an account, but none was given" do @server.should_receive(:user).and_respond("331 User name okay, need password.") @server.should_receive(:pass).and_respond("332 Need account for login.") - lambda { @ftp.login("rubyspec") }.should raise_error(Net::FTPReplyError) + -> { @ftp.login("rubyspec") }.should raise_error(Net::FTPReplyError) end end @@ -69,7 +69,7 @@ describe "Net::FTP#login" do it "raises a Net::FTPReplyError when the server requests an account" do @server.should_receive(:user).and_respond("331 User name okay, need password.") @server.should_receive(:pass).and_respond("332 Need account for login.") - lambda { @ftp.login("rubyspec", "rocks") }.should raise_error(Net::FTPReplyError) + -> { @ftp.login("rubyspec", "rocks") }.should raise_error(Net::FTPReplyError) end end @@ -96,27 +96,27 @@ describe "Net::FTP#login" do describe "when the USER command fails" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:user).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:user).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:user).and_respond("502 Command not implemented.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:user).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:user).and_respond("530 Not logged in.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end end @@ -127,32 +127,32 @@ describe "Net::FTP#login" do it "does not raise an Error when the response code is 202" do @server.should_receive(:pass).and_respond("202 Command not implemented, superfluous at this site.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should_not raise_error + -> { @ftp.login("rubyspec", "rocks", "account") }.should_not raise_error end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:pass).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:pass).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:pass).and_respond("502 Command not implemented.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:pass).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:pass).and_respond("530 Not logged in.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end end @@ -164,32 +164,32 @@ describe "Net::FTP#login" do it "does not raise an Error when the response code is 202" do @server.should_receive(:acct).and_respond("202 Command not implemented, superfluous at this site.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should_not raise_error + -> { @ftp.login("rubyspec", "rocks", "account") }.should_not raise_error end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:acct).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:acct).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:acct).and_respond("502 Command not implemented.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:acct).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:acct).and_respond("530 Not logged in.") - lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) + -> { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError) end end end diff --git a/spec/ruby/library/net/ftp/mdtm_spec.rb b/spec/ruby/library/net/ftp/mdtm_spec.rb index ddcc06d708..b74cf8d3c7 100644 --- a/spec/ruby/library/net/ftp/mdtm_spec.rb +++ b/spec/ruby/library/net/ftp/mdtm_spec.rb @@ -28,11 +28,11 @@ describe "Net::FTP#mdtm" do it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:mdtm).and_respond("550 Requested action not taken.") - lambda { @ftp.mdtm("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.mdtm("test.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:mdtm).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.mdtm("test.file") }.should raise_error(Net::FTPTempError) + -> { @ftp.mdtm("test.file") }.should raise_error(Net::FTPTempError) end end diff --git a/spec/ruby/library/net/ftp/mkdir_spec.rb b/spec/ruby/library/net/ftp/mkdir_spec.rb index 0d8314bfa3..7dc45b5711 100644 --- a/spec/ruby/library/net/ftp/mkdir_spec.rb +++ b/spec/ruby/library/net/ftp/mkdir_spec.rb @@ -31,31 +31,31 @@ describe "Net::FTP#mkdir" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:mkd).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:mkd).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:mkd).and_respond("502 Command not implemented.") - lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:mkd).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPTempError) + -> { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:mkd).and_respond("530 Not logged in.") - lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:mkd).and_respond("550 Requested action not taken.") - lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError) end end diff --git a/spec/ruby/library/net/ftp/mtime_spec.rb b/spec/ruby/library/net/ftp/mtime_spec.rb index e05e92f58f..0f6cc1ba20 100644 --- a/spec/ruby/library/net/ftp/mtime_spec.rb +++ b/spec/ruby/library/net/ftp/mtime_spec.rb @@ -40,11 +40,11 @@ describe "Net::FTP#mtime" do it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:mdtm).and_respond("550 Requested action not taken.") - lambda { @ftp.mtime("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.mtime("test.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:mdtm).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.mtime("test.file") }.should raise_error(Net::FTPTempError) + -> { @ftp.mtime("test.file") }.should raise_error(Net::FTPTempError) end end diff --git a/spec/ruby/library/net/ftp/nlst_spec.rb b/spec/ruby/library/net/ftp/nlst_spec.rb index 36ca7a6127..34384fb8c4 100644 --- a/spec/ruby/library/net/ftp/nlst_spec.rb +++ b/spec/ruby/library/net/ftp/nlst_spec.rb @@ -35,32 +35,32 @@ describe "Net::FTP#nlst" do describe "when the NLST command fails" do it "raises a Net::FTPTempError when the response code is 450" do @server.should_receive(:nlst).and_respond("450 Requested file action not taken..") - lambda { @ftp.nlst }.should raise_error(Net::FTPTempError) + -> { @ftp.nlst }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:nlst).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.nlst }.should raise_error(Net::FTPPermError) + -> { @ftp.nlst }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:nlst).and_respond("501 Syntax error, command unrecognized.") - lambda { @ftp.nlst }.should raise_error(Net::FTPPermError) + -> { @ftp.nlst }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:nlst).and_respond("502 Command not implemented.") - lambda { @ftp.nlst }.should raise_error(Net::FTPPermError) + -> { @ftp.nlst }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:nlst).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.nlst }.should raise_error(Net::FTPTempError) + -> { @ftp.nlst }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:nlst).and_respond("530 Not logged in.") - lambda { @ftp.nlst }.should raise_error(Net::FTPPermError) + -> { @ftp.nlst }.should raise_error(Net::FTPPermError) end end @@ -68,25 +68,25 @@ describe "Net::FTP#nlst" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.") @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.nlst }.should raise_error(Net::FTPPermError) + -> { @ftp.nlst }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.") @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.nlst }.should raise_error(Net::FTPPermError) + -> { @ftp.nlst }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.") @server.should_receive(:port).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.nlst }.should raise_error(Net::FTPTempError) + -> { @ftp.nlst }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:eprt).and_respond("530 Not logged in.") @server.should_receive(:port).and_respond("530 Not logged in.") - lambda { @ftp.nlst }.should raise_error(Net::FTPPermError) + -> { @ftp.nlst }.should raise_error(Net::FTPPermError) end end end diff --git a/spec/ruby/library/net/ftp/noop_spec.rb b/spec/ruby/library/net/ftp/noop_spec.rb index eca8911b7b..070750ced7 100644 --- a/spec/ruby/library/net/ftp/noop_spec.rb +++ b/spec/ruby/library/net/ftp/noop_spec.rb @@ -28,11 +28,11 @@ describe "Net::FTP#noop" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:noop).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.noop }.should raise_error(Net::FTPPermError) + -> { @ftp.noop }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:noop).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.noop }.should raise_error(Net::FTPTempError) + -> { @ftp.noop }.should raise_error(Net::FTPTempError) end end diff --git a/spec/ruby/library/net/ftp/pwd_spec.rb b/spec/ruby/library/net/ftp/pwd_spec.rb index f515cd29a0..a3998cc730 100644 --- a/spec/ruby/library/net/ftp/pwd_spec.rb +++ b/spec/ruby/library/net/ftp/pwd_spec.rb @@ -28,26 +28,26 @@ describe "Net::FTP#pwd" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:pwd).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.pwd }.should raise_error(Net::FTPPermError) + -> { @ftp.pwd }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:pwd).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.pwd }.should raise_error(Net::FTPPermError) + -> { @ftp.pwd }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:pwd).and_respond("502 Command not implemented.") - lambda { @ftp.pwd }.should raise_error(Net::FTPPermError) + -> { @ftp.pwd }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:pwd).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.pwd }.should raise_error(Net::FTPTempError) + -> { @ftp.pwd }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:pwd).and_respond("550 Requested action not taken.") - lambda { @ftp.pwd }.should raise_error(Net::FTPPermError) + -> { @ftp.pwd }.should raise_error(Net::FTPPermError) end end diff --git a/spec/ruby/library/net/ftp/rename_spec.rb b/spec/ruby/library/net/ftp/rename_spec.rb index e1fd4e47cf..376b203ac9 100644 --- a/spec/ruby/library/net/ftp/rename_spec.rb +++ b/spec/ruby/library/net/ftp/rename_spec.rb @@ -31,64 +31,64 @@ describe "Net::FTP#rename" do describe "when the RNFR command fails" do it "raises a Net::FTPTempError when the response code is 450" do @server.should_receive(:rnfr).and_respond("450 Requested file action not taken.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:rnfr).and_respond("550 Requested action not taken.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:rnfr).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:rnfr).and_respond("502 Command not implemented.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:rnfr).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:rnfr).and_respond("530 Not logged in.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end end describe "when the RNTO command fails" do it "raises a Net::FTPPermError when the response code is 532" do @server.should_receive(:rnfr).and_respond("532 Need account for storing files.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 553" do @server.should_receive(:rnto).and_respond("553 Requested action not taken.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:rnto).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:rnto).and_respond("502 Command not implemented.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:rnto).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:rnto).and_respond("530 Not logged in.") - lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError) end end end diff --git a/spec/ruby/library/net/ftp/return_code_spec.rb b/spec/ruby/library/net/ftp/return_code_spec.rb index 605f66ec6e..e4b98c8031 100644 --- a/spec/ruby/library/net/ftp/return_code_spec.rb +++ b/spec/ruby/library/net/ftp/return_code_spec.rb @@ -7,7 +7,7 @@ describe "Net::FTP#return_code" do end it "outputs a warning and returns a newline" do - lambda do + -> do @ftp.return_code.should == "\n" end.should complain(/warning: Net::FTP#return_code is obsolete and do nothing/) end @@ -19,6 +19,6 @@ describe "Net::FTP#return_code=" do end it "outputs a warning" do - lambda { @ftp.return_code = 123 }.should complain(/warning: Net::FTP#return_code= is obsolete and do nothing/) + -> { @ftp.return_code = 123 }.should complain(/warning: Net::FTP#return_code= is obsolete and do nothing/) end end diff --git a/spec/ruby/library/net/ftp/rmdir_spec.rb b/spec/ruby/library/net/ftp/rmdir_spec.rb index ab92a8678b..0515897998 100644 --- a/spec/ruby/library/net/ftp/rmdir_spec.rb +++ b/spec/ruby/library/net/ftp/rmdir_spec.rb @@ -28,31 +28,31 @@ describe "Net::FTP#rmdir" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:rmd).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:rmd).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:rmd).and_respond("502 Command not implemented.") - lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:rmd).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPTempError) + -> { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:rmd).and_respond("530 Not logged in.") - lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:rmd).and_respond("550 Requested action not taken.") - lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) + -> { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError) end end diff --git a/spec/ruby/library/net/ftp/sendcmd_spec.rb b/spec/ruby/library/net/ftp/sendcmd_spec.rb index 631bc10c84..dafa36e032 100644 --- a/spec/ruby/library/net/ftp/sendcmd_spec.rb +++ b/spec/ruby/library/net/ftp/sendcmd_spec.rb @@ -28,27 +28,27 @@ describe "Net::FTP#sendcmd" do it "raises no error when the response code is 1xx, 2xx or 3xx" do @server.should_receive(:help).and_respond("120 Service ready in nnn minutes.") - lambda { @ftp.sendcmd("HELP") }.should_not raise_error + -> { @ftp.sendcmd("HELP") }.should_not raise_error @server.should_receive(:help).and_respond("200 Command okay.") - lambda { @ftp.sendcmd("HELP") }.should_not raise_error + -> { @ftp.sendcmd("HELP") }.should_not raise_error @server.should_receive(:help).and_respond("350 Requested file action pending further information.") - lambda { @ftp.sendcmd("HELP") }.should_not raise_error + -> { @ftp.sendcmd("HELP") }.should_not raise_error end it "raises a Net::FTPTempError when the response code is 4xx" do @server.should_receive(:help).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPTempError) + -> { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 5xx" do @server.should_receive(:help).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPPermError) + -> { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPProtoError when the response code is not between 1xx-5xx" do @server.should_receive(:help).and_respond("999 Invalid response.") - lambda { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPProtoError) + -> { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPProtoError) end end diff --git a/spec/ruby/library/net/ftp/shared/getbinaryfile.rb b/spec/ruby/library/net/ftp/shared/getbinaryfile.rb index 2252935b2d..f324f5b85d 100644 --- a/spec/ruby/library/net/ftp/shared/getbinaryfile.rb +++ b/spec/ruby/library/net/ftp/shared/getbinaryfile.rb @@ -60,32 +60,32 @@ describe :net_ftp_getbinaryfile, shared: :true do describe "and the REST command fails" do it "raises a Net::FTPProtoError when the response code is 550" do @server.should_receive(:rest).and_respond("Requested action not taken.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:rest).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:rest).and_respond("501 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:rest).and_respond("502 Command not implemented.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:rest).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:rest).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end end end @@ -93,32 +93,32 @@ describe :net_ftp_getbinaryfile, shared: :true do describe "when the RETR command fails" do it "raises a Net::FTPTempError when the response code is 450" do @server.should_receive(:retr).and_respond("450 Requested file action not taken.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPProtoError when the response code is 550" do @server.should_receive(:retr).and_respond("Requested action not taken.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:retr).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:retr).and_respond("501 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:retr).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:retr).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end end @@ -126,25 +126,25 @@ describe :net_ftp_getbinaryfile, shared: :true do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.") @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.") @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.") @server.should_receive(:port).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:eprt).and_respond("530 Not logged in.") @server.should_receive(:port).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end end end diff --git a/spec/ruby/library/net/ftp/shared/gettextfile.rb b/spec/ruby/library/net/ftp/shared/gettextfile.rb index 6219581d12..82bec2a4a7 100644 --- a/spec/ruby/library/net/ftp/shared/gettextfile.rb +++ b/spec/ruby/library/net/ftp/shared/gettextfile.rb @@ -43,32 +43,32 @@ describe :net_ftp_gettextfile, shared: :true do describe "when the RETR command fails" do it "raises a Net::FTPTempError when the response code is 450" do @server.should_receive(:retr).and_respond("450 Requested file action not taken.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPProtoError when the response code is 550" do @server.should_receive(:retr).and_respond("Requested action not taken.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:retr).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:retr).and_respond("501 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:retr).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:retr).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end end @@ -76,25 +76,25 @@ describe :net_ftp_gettextfile, shared: :true do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.") @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.") @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.") @server.should_receive(:port).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:eprt).and_respond("530 Not logged in.") @server.should_receive(:port).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError) end end end diff --git a/spec/ruby/library/net/ftp/shared/list.rb b/spec/ruby/library/net/ftp/shared/list.rb index 50ca8ad119..adc3fa59c1 100644 --- a/spec/ruby/library/net/ftp/shared/list.rb +++ b/spec/ruby/library/net/ftp/shared/list.rb @@ -47,32 +47,32 @@ describe :net_ftp_list, shared: true do describe "when the LIST command fails" do it "raises a Net::FTPTempError when the response code is 450" do @server.should_receive(:list).and_respond("450 Requested file action not taken..") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:list).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:list).and_respond("501 Syntax error, command unrecognized.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:list).and_respond("502 Command not implemented.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:list).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:list).and_respond("530 Not logged in.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPPermError) end end @@ -80,25 +80,25 @@ describe :net_ftp_list, shared: true do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.") @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.") @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.") @server.should_receive(:port).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:eprt).and_respond("530 Not logged in.") @server.should_receive(:port).and_respond("530 Not logged in.") - lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method) }.should raise_error(Net::FTPPermError) end end end diff --git a/spec/ruby/library/net/ftp/shared/putbinaryfile.rb b/spec/ruby/library/net/ftp/shared/putbinaryfile.rb index 74eaf320ae..1163a1cfea 100644 --- a/spec/ruby/library/net/ftp/shared/putbinaryfile.rb +++ b/spec/ruby/library/net/ftp/shared/putbinaryfile.rb @@ -67,32 +67,32 @@ describe :net_ftp_putbinaryfile, shared: :true do describe "and the APPE command fails" do it "raises a Net::FTPProtoError when the response code is 550" do @server.should_receive(:appe).and_respond("Requested action not taken.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPProtoError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPProtoError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:appe).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:appe).and_respond("501 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:appe).and_respond("502 Command not implemented.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:appe).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:appe).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end end end @@ -100,42 +100,42 @@ describe :net_ftp_putbinaryfile, shared: :true do describe "when the STOR command fails" do it "raises a Net::FTPPermError when the response code is 532" do @server.should_receive(:stor).and_respond("532 Need account for storing files.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 450" do @server.should_receive(:stor).and_respond("450 Requested file action not taken.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPTempError when the response code is 452" do @server.should_receive(:stor).and_respond("452 Requested action not taken.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 553" do @server.should_receive(:stor).and_respond("553 Requested action not taken.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:stor).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:stor).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:stor).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:stor).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end end @@ -143,25 +143,25 @@ describe :net_ftp_putbinaryfile, shared: :true do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.") @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.") @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.") @server.should_receive(:port).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:eprt).and_respond("530 Not logged in.") @server.should_receive(:port).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError) end end end diff --git a/spec/ruby/library/net/ftp/shared/puttextfile.rb b/spec/ruby/library/net/ftp/shared/puttextfile.rb index 9bfdc7c41e..50e8de28e6 100644 --- a/spec/ruby/library/net/ftp/shared/puttextfile.rb +++ b/spec/ruby/library/net/ftp/shared/puttextfile.rb @@ -53,42 +53,42 @@ describe :net_ftp_puttextfile, shared: true do describe "when the STOR command fails" do it "raises a Net::FTPPermError when the response code is 532" do @server.should_receive(:stor).and_respond("532 Need account for storing files.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 450" do @server.should_receive(:stor).and_respond("450 Requested file action not taken.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPTempError when the response code is 452" do @server.should_receive(:stor).and_respond("452 Requested action not taken.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 553" do @server.should_receive(:stor).and_respond("553 Requested action not taken.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:stor).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:stor).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:stor).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:stor).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) end end @@ -96,25 +96,25 @@ describe :net_ftp_puttextfile, shared: true do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.") @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.") @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.") @server.should_receive(:port).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:eprt).and_respond("530 Not logged in.") @server.should_receive(:port).and_respond("530 Not logged in.") - lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) + -> { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError) end end end diff --git a/spec/ruby/library/net/ftp/site_spec.rb b/spec/ruby/library/net/ftp/site_spec.rb index 85aa2609c1..4d6a9b4a0c 100644 --- a/spec/ruby/library/net/ftp/site_spec.rb +++ b/spec/ruby/library/net/ftp/site_spec.rb @@ -28,26 +28,26 @@ describe "Net::FTP#site" do it "does not raise an error when the response code is 202" do @server.should_receive(:site).and_respond("202 Command not implemented, superfluous at this site.") - lambda { @ftp.site("param") }.should_not raise_error + -> { @ftp.site("param") }.should_not raise_error end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:site).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.site("param") }.should raise_error(Net::FTPPermError) + -> { @ftp.site("param") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:site).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.site("param") }.should raise_error(Net::FTPPermError) + -> { @ftp.site("param") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:site).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.site("param") }.should raise_error(Net::FTPTempError) + -> { @ftp.site("param") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:site).and_respond("530 Requested action not taken.") - lambda { @ftp.site("param") }.should raise_error(Net::FTPPermError) + -> { @ftp.site("param") }.should raise_error(Net::FTPPermError) end end diff --git a/spec/ruby/library/net/ftp/size_spec.rb b/spec/ruby/library/net/ftp/size_spec.rb index eb3ee90d0f..17615079e9 100644 --- a/spec/ruby/library/net/ftp/size_spec.rb +++ b/spec/ruby/library/net/ftp/size_spec.rb @@ -28,21 +28,21 @@ describe "Net::FTP#size" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:size).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.size("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.size("test.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:size).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.size("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.size("test.file") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:size).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.size("test.file") }.should raise_error(Net::FTPTempError) + -> { @ftp.size("test.file") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 550" do @server.should_receive(:size).and_respond("550 Requested action not taken.") - lambda { @ftp.size("test.file") }.should raise_error(Net::FTPPermError) + -> { @ftp.size("test.file") }.should raise_error(Net::FTPPermError) end end diff --git a/spec/ruby/library/net/ftp/status_spec.rb b/spec/ruby/library/net/ftp/status_spec.rb index c3874ea41e..6e3840bf93 100644 --- a/spec/ruby/library/net/ftp/status_spec.rb +++ b/spec/ruby/library/net/ftp/status_spec.rb @@ -32,36 +32,36 @@ describe "Net::FTP#status" do it "does not raise an error when the response code is 212" do @server.should_receive(:stat).and_respond("212 Directory status.") - lambda { @ftp.status }.should_not raise_error + -> { @ftp.status }.should_not raise_error end it "does not raise an error when the response code is 213" do @server.should_receive(:stat).and_respond("213 File status.") - lambda { @ftp.status }.should_not raise_error + -> { @ftp.status }.should_not raise_error end it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:stat).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.status }.should raise_error(Net::FTPPermError) + -> { @ftp.status }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:stat).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.status }.should raise_error(Net::FTPPermError) + -> { @ftp.status }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:stat).and_respond("502 Command not implemented.") - lambda { @ftp.status }.should raise_error(Net::FTPPermError) + -> { @ftp.status }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:stat).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.status }.should raise_error(Net::FTPTempError) + -> { @ftp.status }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 530" do @server.should_receive(:stat).and_respond("530 Requested action not taken.") - lambda { @ftp.status }.should raise_error(Net::FTPPermError) + -> { @ftp.status }.should raise_error(Net::FTPPermError) end end diff --git a/spec/ruby/library/net/ftp/system_spec.rb b/spec/ruby/library/net/ftp/system_spec.rb index 73a5ddc72f..749258622d 100644 --- a/spec/ruby/library/net/ftp/system_spec.rb +++ b/spec/ruby/library/net/ftp/system_spec.rb @@ -28,21 +28,21 @@ describe "Net::FTP#system" do it "raises a Net::FTPPermError when the response code is 500" do @server.should_receive(:syst).and_respond("500 Syntax error, command unrecognized.") - lambda { @ftp.system }.should raise_error(Net::FTPPermError) + -> { @ftp.system }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 501" do @server.should_receive(:syst).and_respond("501 Syntax error in parameters or arguments.") - lambda { @ftp.system }.should raise_error(Net::FTPPermError) + -> { @ftp.system }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPPermError when the response code is 502" do @server.should_receive(:syst).and_respond("502 Command not implemented.") - lambda { @ftp.system }.should raise_error(Net::FTPPermError) + -> { @ftp.system }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPTempError when the response code is 421" do @server.should_receive(:syst).and_respond("421 Service not available, closing control connection.") - lambda { @ftp.system }.should raise_error(Net::FTPTempError) + -> { @ftp.system }.should raise_error(Net::FTPTempError) end end diff --git a/spec/ruby/library/net/ftp/voidcmd_spec.rb b/spec/ruby/library/net/ftp/voidcmd_spec.rb index 5e82b70a78..3673c7fd5b 100644 --- a/spec/ruby/library/net/ftp/voidcmd_spec.rb +++ b/spec/ruby/library/net/ftp/voidcmd_spec.rb @@ -19,7 +19,7 @@ describe "Net::FTP#voidcmd" do it "sends the passed command to the server" do @server.should_receive(:help).and_respond("2xx Does not raise.") - lambda { @ftp.voidcmd("HELP") }.should_not raise_error + -> { @ftp.voidcmd("HELP") }.should_not raise_error end it "returns nil" do @@ -29,26 +29,26 @@ describe "Net::FTP#voidcmd" do it "raises a Net::FTPReplyError when the response code is 1xx" do @server.should_receive(:help).and_respond("1xx Does raise a Net::FTPReplyError.") - lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPReplyError) + -> { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPReplyError) end it "raises a Net::FTPReplyError when the response code is 3xx" do @server.should_receive(:help).and_respond("3xx Does raise a Net::FTPReplyError.") - lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPReplyError) + -> { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPReplyError) end it "raises a Net::FTPTempError when the response code is 4xx" do @server.should_receive(:help).and_respond("4xx Does raise a Net::FTPTempError.") - lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPTempError) + -> { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPTempError) end it "raises a Net::FTPPermError when the response code is 5xx" do @server.should_receive(:help).and_respond("5xx Does raise a Net::FTPPermError.") - lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPPermError) + -> { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPPermError) end it "raises a Net::FTPProtoError when the response code is not valid" do @server.should_receive(:help).and_respond("999 Does raise a Net::FTPProtoError.") - lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPProtoError) + -> { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPProtoError) end end diff --git a/spec/ruby/library/net/http/HTTPServerException_spec.rb b/spec/ruby/library/net/http/HTTPServerException_spec.rb index 3960effadd..87841ab499 100644 --- a/spec/ruby/library/net/http/HTTPServerException_spec.rb +++ b/spec/ruby/library/net/http/HTTPServerException_spec.rb @@ -16,11 +16,11 @@ end ruby_version_is "2.6" do describe "Net::HTTPServerException" do it "is a subclass of Net::ProtoServerError and is warned as deprecated" do - lambda { Net::HTTPServerException.should < Net::ProtoServerError }.should complain(/warning: constant Net::HTTPServerException is deprecated/) + -> { Net::HTTPServerException.should < Net::ProtoServerError }.should complain(/warning: constant Net::HTTPServerException is deprecated/) end it "includes the Net::HTTPExceptions module and is warned as deprecated" do - lambda { Net::HTTPServerException.should < Net::HTTPExceptions }.should complain(/warning: constant Net::HTTPServerException is deprecated/) + -> { Net::HTTPServerException.should < Net::HTTPExceptions }.should complain(/warning: constant Net::HTTPServerException is deprecated/) end end end diff --git a/spec/ruby/library/net/http/http/finish_spec.rb b/spec/ruby/library/net/http/http/finish_spec.rb index b031c58e2c..f98bc7be13 100644 --- a/spec/ruby/library/net/http/http/finish_spec.rb +++ b/spec/ruby/library/net/http/http/finish_spec.rb @@ -23,7 +23,7 @@ describe "Net::HTTP#finish" do describe "when self has not been started yet" do it "raises an IOError" do - lambda { @http.finish }.should raise_error(IOError) + -> { @http.finish }.should raise_error(IOError) end end end diff --git a/spec/ruby/library/net/http/http/get_print_spec.rb b/spec/ruby/library/net/http/http/get_print_spec.rb index 6174e3eb21..f59dd68c81 100644 --- a/spec/ruby/library/net/http/http/get_print_spec.rb +++ b/spec/ruby/library/net/http/http/get_print_spec.rb @@ -14,7 +14,7 @@ describe "Net::HTTP.get_print" do describe "when passed URI" do it "it prints the body of the specified uri to $stdout" do - lambda do + -> do Net::HTTP.get_print URI.parse("http://localhost:#{@port}/") end.should output(/This is the index page\./) end @@ -22,7 +22,7 @@ describe "Net::HTTP.get_print" do describe "when passed host, path, port" do it "it prints the body of the specified uri to $stdout" do - lambda do + -> do Net::HTTP.get_print 'localhost', "/", @port end.should output(/This is the index page\./) end diff --git a/spec/ruby/library/net/http/http/set_debug_output_spec.rb b/spec/ruby/library/net/http/http/set_debug_output_spec.rb index e0fe4796da..94b6f4499d 100644 --- a/spec/ruby/library/net/http/http/set_debug_output_spec.rb +++ b/spec/ruby/library/net/http/http/set_debug_output_spec.rb @@ -28,6 +28,6 @@ describe "Net::HTTP#set_debug_output when passed io" do it "outputs a warning when the connection has already been started" do @http.start - lambda { @http.set_debug_output(StringIO.new) }.should complain(/Net::HTTP#set_debug_output called after HTTP started/) + -> { @http.set_debug_output(StringIO.new) }.should complain(/Net::HTTP#set_debug_output called after HTTP started/) end end diff --git a/spec/ruby/library/net/http/http/start_spec.rb b/spec/ruby/library/net/http/http/start_spec.rb index e23f9183f7..a2768eed18 100644 --- a/spec/ruby/library/net/http/http/start_spec.rb +++ b/spec/ruby/library/net/http/http/start_spec.rb @@ -81,7 +81,7 @@ describe "Net::HTTP#start" do describe "when self has already been started" do it "raises an IOError" do @http.start - lambda { @http.start }.should raise_error(IOError) + -> { @http.start }.should raise_error(IOError) end end diff --git a/spec/ruby/library/net/http/httpgenericrequest/body_exist_spec.rb b/spec/ruby/library/net/http/httpgenericrequest/body_exist_spec.rb index 9b04bffb2e..7d081939b8 100644 --- a/spec/ruby/library/net/http/httpgenericrequest/body_exist_spec.rb +++ b/spec/ruby/library/net/http/httpgenericrequest/body_exist_spec.rb @@ -13,7 +13,7 @@ describe "Net::HTTPGenericRequest#body_exist?" do describe "when $VERBOSE is true" do it "emits a warning" do request = Net::HTTPGenericRequest.new("POST", true, false, "/some/path") - lambda { + -> { request.body_exist? }.should complain(/body_exist\? is obsolete/, verbose: true) end diff --git a/spec/ruby/library/net/http/httpgenericrequest/exec_spec.rb b/spec/ruby/library/net/http/httpgenericrequest/exec_spec.rb index 90e158a159..da5b1a63be 100644 --- a/spec/ruby/library/net/http/httpgenericrequest/exec_spec.rb +++ b/spec/ruby/library/net/http/httpgenericrequest/exec_spec.rb @@ -125,7 +125,7 @@ describe "Net::HTTPGenericRequest#exec when passed socket, version, path" do "Content-Type" => "text/html") request.body_stream = StringIO.new("Some Content") - lambda { request.exec(@buffered_socket, "1.1", "/some/other/path") }.should raise_error(ArgumentError) + -> { request.exec(@buffered_socket, "1.1", "/some/other/path") }.should raise_error(ArgumentError) end end end diff --git a/spec/ruby/library/net/http/httpgenericrequest/set_body_internal_spec.rb b/spec/ruby/library/net/http/httpgenericrequest/set_body_internal_spec.rb index ef2edc019a..7494c69173 100644 --- a/spec/ruby/library/net/http/httpgenericrequest/set_body_internal_spec.rb +++ b/spec/ruby/library/net/http/httpgenericrequest/set_body_internal_spec.rb @@ -13,9 +13,9 @@ describe "Net::HTTPGenericRequest#set_body_internal when passed string" do it "raises an ArgumentError when the body or body_stream of self have already been set" do @request.body = "Some Content" - lambda { @request.set_body_internal("Some other Content") }.should raise_error(ArgumentError) + -> { @request.set_body_internal("Some other Content") }.should raise_error(ArgumentError) @request.body_stream = "Some Content" - lambda { @request.set_body_internal("Some other Content") }.should raise_error(ArgumentError) + -> { @request.set_body_internal("Some other Content") }.should raise_error(ArgumentError) end end diff --git a/spec/ruby/library/net/http/httpheader/content_length_spec.rb b/spec/ruby/library/net/http/httpheader/content_length_spec.rb index 44c971c98e..e344817e82 100644 --- a/spec/ruby/library/net/http/httpheader/content_length_spec.rb +++ b/spec/ruby/library/net/http/httpheader/content_length_spec.rb @@ -13,7 +13,7 @@ describe "Net::HTTPHeader#content_length" do it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Length' header entry has an invalid format" do @headers["Content-Length"] = "invalid" - lambda { @headers.content_length }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.content_length }.should raise_error(Net::HTTPHeaderSyntaxError) end it "returns the value of the 'Content-Length' header entry as an Integer" do diff --git a/spec/ruby/library/net/http/httpheader/content_range_spec.rb b/spec/ruby/library/net/http/httpheader/content_range_spec.rb index 23dc92348b..ba75f9a9a1 100644 --- a/spec/ruby/library/net/http/httpheader/content_range_spec.rb +++ b/spec/ruby/library/net/http/httpheader/content_range_spec.rb @@ -21,12 +21,12 @@ describe "Net::HTTPHeader#content_range" do it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Range' has an invalid format" do @headers["Content-Range"] = "invalid" - lambda { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError) @headers["Content-Range"] = "bytes 123-abc" - lambda { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError) @headers["Content-Range"] = "bytes abc-123" - lambda { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError) end end diff --git a/spec/ruby/library/net/http/httpheader/fetch_spec.rb b/spec/ruby/library/net/http/httpheader/fetch_spec.rb index 4d608cdb0d..ea15679acb 100644 --- a/spec/ruby/library/net/http/httpheader/fetch_spec.rb +++ b/spec/ruby/library/net/http/httpheader/fetch_spec.rb @@ -25,7 +25,7 @@ describe "Net::HTTPHeader#fetch" do end it "returns nil when there is no entry for the passed key" do - lambda { @headers.fetch("my-header") }.should raise_error(IndexError) + -> { @headers.fetch("my-header") }.should raise_error(IndexError) end end diff --git a/spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb b/spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb index 35768b4e7e..efc5e7d0b2 100644 --- a/spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb +++ b/spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb @@ -14,7 +14,7 @@ describe "Net::HTTPHeader#initialize_http_header when passed Hash" do end it "complains about duplicate keys when in verbose mode" do - lambda do + -> do @headers.initialize_http_header("My-Header" => "test", "my-header" => "another test") end.should complain(/duplicated HTTP header/, verbose: true) end diff --git a/spec/ruby/library/net/http/httpheader/range_length_spec.rb b/spec/ruby/library/net/http/httpheader/range_length_spec.rb index 4415c8e5ba..b8fce4f690 100644 --- a/spec/ruby/library/net/http/httpheader/range_length_spec.rb +++ b/spec/ruby/library/net/http/httpheader/range_length_spec.rb @@ -21,12 +21,12 @@ describe "Net::HTTPHeader#range_length" do it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Range' has an invalid format" do @headers["Content-Range"] = "invalid" - lambda { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError) @headers["Content-Range"] = "bytes 123-abc" - lambda { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError) @headers["Content-Range"] = "bytes abc-123" - lambda { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError) end end diff --git a/spec/ruby/library/net/http/httpheader/range_spec.rb b/spec/ruby/library/net/http/httpheader/range_spec.rb index 5f06e03a1c..005177f6be 100644 --- a/spec/ruby/library/net/http/httpheader/range_spec.rb +++ b/spec/ruby/library/net/http/httpheader/range_spec.rb @@ -28,18 +28,18 @@ describe "Net::HTTPHeader#range" do it "raises a Net::HTTPHeaderSyntaxError when the 'Range' has an invalid format" do @headers["Range"] = "invalid" - lambda { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError) @headers["Range"] = "bytes 123-abc" - lambda { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError) @headers["Range"] = "bytes abc-123" - lambda { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError) end it "raises a Net::HTTPHeaderSyntaxError when the 'Range' was not specified" do @headers["Range"] = "bytes=-" - lambda { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError) end end diff --git a/spec/ruby/library/net/http/httpheader/shared/set_range.rb b/spec/ruby/library/net/http/httpheader/shared/set_range.rb index 6a98edbe10..87f51d46f3 100644 --- a/spec/ruby/library/net/http/httpheader/shared/set_range.rb +++ b/spec/ruby/library/net/http/httpheader/shared/set_range.rb @@ -50,15 +50,15 @@ describe :net_httpheader_set_range, shared: true do end it "raises a Net::HTTPHeaderSyntaxError when the first Range element is negative" do - lambda { @headers.send(@method, -10..5) }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.send(@method, -10..5) }.should raise_error(Net::HTTPHeaderSyntaxError) end it "raises a Net::HTTPHeaderSyntaxError when the last Range element is negative" do - lambda { @headers.send(@method, 10..-5) }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.send(@method, 10..-5) }.should raise_error(Net::HTTPHeaderSyntaxError) end it "raises a Net::HTTPHeaderSyntaxError when the last Range element is smaller than the first" do - lambda { @headers.send(@method, 10..5) }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.send(@method, 10..5) }.should raise_error(Net::HTTPHeaderSyntaxError) end end @@ -75,15 +75,15 @@ describe :net_httpheader_set_range, shared: true do end it "raises a Net::HTTPHeaderSyntaxError when start is negative" do - lambda { @headers.send(@method, -10, 5) }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.send(@method, -10, 5) }.should raise_error(Net::HTTPHeaderSyntaxError) end it "raises a Net::HTTPHeaderSyntaxError when start + length is negative" do - lambda { @headers.send(@method, 10, -15) }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.send(@method, 10, -15) }.should raise_error(Net::HTTPHeaderSyntaxError) end it "raises a Net::HTTPHeaderSyntaxError when length is negative" do - lambda { @headers.send(@method, 10, -4) }.should raise_error(Net::HTTPHeaderSyntaxError) + -> { @headers.send(@method, 10, -4) }.should raise_error(Net::HTTPHeaderSyntaxError) end end end diff --git a/spec/ruby/library/net/http/httpresponse/error_spec.rb b/spec/ruby/library/net/http/httpresponse/error_spec.rb index a3a3cee162..d2b2f53d89 100644 --- a/spec/ruby/library/net/http/httpresponse/error_spec.rb +++ b/spec/ruby/library/net/http/httpresponse/error_spec.rb @@ -4,26 +4,26 @@ require 'net/http' describe "Net::HTTPResponse#error!" do it "raises self's class 'EXCEPTION_TYPE' Exception" do res = Net::HTTPUnknownResponse.new("1.0", "???", "test response") - lambda { res.error! }.should raise_error(Net::HTTPError) + -> { res.error! }.should raise_error(Net::HTTPError) res = Net::HTTPInformation.new("1.0", "1xx", "test response") - lambda { res.error! }.should raise_error(Net::HTTPError) + -> { res.error! }.should raise_error(Net::HTTPError) res = Net::HTTPSuccess.new("1.0", "2xx", "test response") - lambda { res.error! }.should raise_error(Net::HTTPError) + -> { res.error! }.should raise_error(Net::HTTPError) res = Net::HTTPRedirection.new("1.0", "3xx", "test response") - lambda { res.error! }.should raise_error(Net::HTTPRetriableError) + -> { res.error! }.should raise_error(Net::HTTPRetriableError) res = Net::HTTPClientError.new("1.0", "4xx", "test response") ruby_version_is ""..."2.6" do - lambda { res.error! }.should raise_error(Net::HTTPServerException) + -> { res.error! }.should raise_error(Net::HTTPServerException) end ruby_version_is "2.6" do - lambda { res.error! }.should raise_error(Net::HTTPClientException) + -> { res.error! }.should raise_error(Net::HTTPClientException) end res = Net::HTTPServerError.new("1.0", "5xx", "test response") - lambda { res.error! }.should raise_error(Net::HTTPFatalError) + -> { res.error! }.should raise_error(Net::HTTPFatalError) end end diff --git a/spec/ruby/library/net/http/httpresponse/read_body_spec.rb b/spec/ruby/library/net/http/httpresponse/read_body_spec.rb index a050eca594..99d8e5fa88 100644 --- a/spec/ruby/library/net/http/httpresponse/read_body_spec.rb +++ b/spec/ruby/library/net/http/httpresponse/read_body_spec.rb @@ -40,7 +40,7 @@ describe "Net::HTTPResponse#read_body" do it "raises an IOError if called a second time" do @res.reading_body(@socket, true) do @res.read_body("") - lambda { @res.read_body("") }.should raise_error(IOError) + -> { @res.read_body("") }.should raise_error(IOError) end end end @@ -70,7 +70,7 @@ describe "Net::HTTPResponse#read_body" do it "raises an IOError if called a second time" do @res.reading_body(@socket, true) do @res.read_body {} - lambda { @res.read_body {} }.should raise_error(IOError) + -> { @res.read_body {} }.should raise_error(IOError) end end end @@ -78,7 +78,7 @@ describe "Net::HTTPResponse#read_body" do describe "when passed buffer and block" do it "raises an ArgumentError" do @res.reading_body(@socket, true) do - lambda { @res.read_body("") {} }.should raise_error(ArgumentError) + -> { @res.read_body("") {} }.should raise_error(ArgumentError) end end end diff --git a/spec/ruby/library/net/http/httpresponse/value_spec.rb b/spec/ruby/library/net/http/httpresponse/value_spec.rb index 1b19d1d6f7..4a5930d4e5 100644 --- a/spec/ruby/library/net/http/httpresponse/value_spec.rb +++ b/spec/ruby/library/net/http/httpresponse/value_spec.rb @@ -4,26 +4,26 @@ require 'net/http' describe "Net::HTTPResponse#value" do it "raises an HTTP error for non 2xx HTTP Responses" do res = Net::HTTPUnknownResponse.new("1.0", "???", "test response") - lambda { res.value }.should raise_error(Net::HTTPError) + -> { res.value }.should raise_error(Net::HTTPError) res = Net::HTTPInformation.new("1.0", "1xx", "test response") - lambda { res.value }.should raise_error(Net::HTTPError) + -> { res.value }.should raise_error(Net::HTTPError) res = Net::HTTPSuccess.new("1.0", "2xx", "test response") - lambda { res.value }.should_not raise_error(Net::HTTPError) + -> { res.value }.should_not raise_error(Net::HTTPError) res = Net::HTTPRedirection.new("1.0", "3xx", "test response") - lambda { res.value }.should raise_error(Net::HTTPRetriableError) + -> { res.value }.should raise_error(Net::HTTPRetriableError) res = Net::HTTPClientError.new("1.0", "4xx", "test response") ruby_version_is ""..."2.6" do - lambda { res.value }.should raise_error(Net::HTTPServerException) + -> { res.value }.should raise_error(Net::HTTPServerException) end ruby_version_is "2.6" do - lambda { res.value }.should raise_error(Net::HTTPClientException) + -> { res.value }.should raise_error(Net::HTTPClientException) end res = Net::HTTPServerError.new("1.0", "5xx", "test response") - lambda { res.value }.should raise_error(Net::HTTPFatalError) + -> { res.value }.should raise_error(Net::HTTPFatalError) end end |