Sha256: 583de668d0cc48e581d3d0fdb171170a3df420df33dc97b7cabe0dd5dfd53117

Contents?: true

Size: 934 Bytes

Versions: 19

Compression:

Stored size: 934 Bytes

Contents

require File.expand_path('../../../../spec_helper', __FILE__)
require 'net/ftp'
require File.expand_path('../fixtures/server', __FILE__)

describe "Net::FTP#retrbinary" do
  before(:each) do
    @server = NetFTPSpecs::DummyFTP.new
    @server.serve_once

    @ftp = Net::FTP.new
    @ftp.connect("127.0.0.1", 9876)
  end

  after(:each) do
    @ftp.quit rescue nil
    @ftp.close
    @server.stop
  end
if System::get_property('platform') != 'WINDOWS' && System.get_property('platform') != 'WINDOWS_DESKTOP'
  it "sends the passed command to the server" do
    @ftp.retrbinary("RETR test", 4096) {}
    @ftp.last_response.should == "226 Closing data connection. (RETR test)\n"
  end

  it "yields the received content as binary blocks of the passed size" do
    res = []
    @ftp.retrbinary("RETR test", 10) { |bin| res << bin }
    res.should == [ "This is th", "e content\n", "of the fil", "e named 't", "est'.\n" ]
  end
end  
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
rhodes-7.6.0 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-7.5.1 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-7.4.1 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-7.1.17 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-6.2.0 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-6.0.11 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-5.5.18 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-5.5.17 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-5.5.15 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-5.5.2 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-5.5.0 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb
rhodes-3.4.2 spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb