diff options
Diffstat (limited to 'spec/ruby/library/net/ftp/shared/putbinaryfile.rb')
-rw-r--r-- | spec/ruby/library/net/ftp/shared/putbinaryfile.rb | 36 |
1 files changed, 18 insertions, 18 deletions
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 |