Sha256: 8f2840ce8f58a78799f0f20208675d00b836e8cd99f5f9a3ab120e325bcd51ba

Contents?: true

Size: 898 Bytes

Versions: 2

Compression:

Stored size: 898 Bytes

Contents

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

class TestNetFTPListNetware < Test::Unit::TestCase

  def setup
    @dir  = Net::FTP::List.parse('d [RWCEAFMS] dpearce                          512 Jun 27 23:46 public.www')
    @file = Net::FTP::List.parse('- [RWCEAFMS] dpearce                         2767 Jun 22 06:22 about.html')
  end

  def test_parse_new
    assert_instance_of Net::FTP::List::Netware, @dir, 'LIST Netware directory'
    assert_instance_of Net::FTP::List::Netware, @file, 'LIST Netware file'
  end

  def test_rubbish_lines
    assert_instance_of Net::FTP::List::Unknown, Net::FTP::List.parse("++ bah! ++")
  end

  def test_ruby_netware_like_dir
    assert_equal 'public.www', @dir.basename
    assert @dir.dir?
    assert !@dir.file?
  end

  def test_ruby_netware_like_file
    assert_equal 'about.html', @file.basename
    assert @file.file?
    assert !@file.dir?
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
net-ftp-list-2.0.0 test/test_net_ftp_list_netware.rb
net-ftp-list-2.0 test/test_net_ftp_list_netware.rb