diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-28 15:15:48 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-28 15:15:48 +0000 |
commit | 8c5b60eb22d6d661e87992a65d54e3a5bc0aeed4 (patch) | |
tree | 7905b284cb5b3d62c17ad8a939e339621a498a2c /spec/ruby/library/net/ftp | |
parent | 6530b14cee76e2512424d225e64d3c61dd1f6511 (diff) |
Update to ruby/spec@a6b8805
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/net/ftp')
-rw-r--r-- | spec/ruby/library/net/ftp/fixtures/server.rb | 10 | ||||
-rw-r--r-- | spec/ruby/library/net/ftp/status_spec.rb | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/spec/ruby/library/net/ftp/fixtures/server.rb b/spec/ruby/library/net/ftp/fixtures/server.rb index a6741820ff..65339cfaf9 100644 --- a/spec/ruby/library/net/ftp/fixtures/server.rb +++ b/spec/ruby/library/net/ftp/fixtures/server.rb @@ -35,7 +35,7 @@ module NetFTPSpecs response @connect_message || "220 Dummy FTP Server ready!" begin - while command = @socket.recv(1024) + while command = @socket.gets command, argument = command.chomp.split(" ", 2) if command == "QUIT" @@ -229,8 +229,12 @@ module NetFTPSpecs end end - def stat - self.response("211 System status, or system help reply. (STAT)") + def stat(param = :default) + if param == :default + self.response("211 System status, or system help reply. (STAT)") + else + self.response("211 System status, or system help reply. (STAT #{param})") + end end def stor(file) diff --git a/spec/ruby/library/net/ftp/status_spec.rb b/spec/ruby/library/net/ftp/status_spec.rb index 7e9927c3c8..243d3fc175 100644 --- a/spec/ruby/library/net/ftp/status_spec.rb +++ b/spec/ruby/library/net/ftp/status_spec.rb @@ -22,6 +22,12 @@ describe "Net::FTP#status" do @ftp.last_response.should == "211 System status, or system help reply. (STAT)\n" end + ruby_version_is "2.4" do + it "sends the STAT command with an optional parameter to the server" do + @ftp.status("/pub").should == "211 System status, or system help reply. (STAT /pub)\n" + end + end + it "returns the received information" do @ftp.status.should == "211 System status, or system help reply. (STAT)\n" end |