Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions library/net/ftp/fixtures/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,12 @@ def size(filename)
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)
Expand Down
6 changes: 6 additions & 0 deletions library/net/ftp/status_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
@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
Expand Down