Sha256: 1a23b1c83fba1e740a4c3cababd8e1aee62169b84f43e7932d06c8bf71778d77

Contents?: true

Size: 726 Bytes

Versions: 12

Compression:

Stored size: 726 Bytes

Contents

require 'test/unit'
require 'net/ftp/list'

class TestNetFTPList < Test::Unit::TestCase

  def test_all
    one = Net::FTP::List.parse('drwxr-xr-x 4 user     group    4096 Dec 10 20:23 etc')
    assert_kind_of Net::FTP::List::Entry, one
    assert one.dir?
    assert !one.file?

    two = Net::FTP::List.parse("++ unknown garbage +++")
    assert_kind_of Net::FTP::List::Entry, two
    assert two.unknown?
    assert_equal '', two.basename
  end

  def test_raise_when_flag_set
    Net::FTP::List.raise_on_failed_server_detection = true
    assert_raise(Net::FTP::List::ParseError) do
      Net::FTP::List.parse("++ unknown garbage +++")
    end
  ensure
    Net::FTP::List.raise_on_failed_server_detection = false
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
net-ftp-list-3.2.11 test/test_net_ftp_list.rb
net-ftp-list-3.2.10 test/test_net_ftp_list.rb
net-ftp-list-3.2.9 test/test_net_ftp_list.rb
net-ftp-list-3.2.8 test/test_net_ftp_list.rb
net-ftp-list-3.2.7 test/test_net_ftp_list.rb
net-ftp-list-3.2.6 test/test_net_ftp_list.rb
net-ftp-list-3.2.5 test/test_net_ftp_list.rb
net-ftp-list-3.2.4 test/test_net_ftp_list.rb
net-ftp-list-3.2.3 test/test_net_ftp_list.rb
net-ftp-list-3.2.2 test/test_net_ftp_list.rb
net-ftp-list-3.2.1 test/test_net_ftp_list.rb
net-ftp-list-3.2.0 test/test_net_ftp_list.rb