diff options
Diffstat (limited to 'spec/ruby/library/net/ftp/shared')
-rw-r--r-- | spec/ruby/library/net/ftp/shared/getbinaryfile.rb | 32 | ||||
-rw-r--r-- | spec/ruby/library/net/ftp/shared/gettextfile.rb | 20 | ||||
-rw-r--r-- | spec/ruby/library/net/ftp/shared/list.rb | 20 | ||||
-rw-r--r-- | spec/ruby/library/net/ftp/shared/putbinaryfile.rb | 36 | ||||
-rw-r--r-- | spec/ruby/library/net/ftp/shared/puttextfile.rb | 24 |
5 files changed, 66 insertions, 66 deletions
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 |