Sha256: cec7fad4a152b5d76c273a1459418932ff1b7abd4a6735cb13717adefb08135c

Contents?: true

Size: 1.03 KB

Versions: 29

Compression:

Stored size: 1.03 KB

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_mtime
    assert_equal @dir.mtime, Time.parse('Jun 27 23:46')
    assert_equal @file.mtime, Time.parse('Jun 22 06:22')
  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

29 entries across 29 versions & 2 rubygems

Version Path
redcar-dev-0.12.1dev-java plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-dev-0.12.0dev-java plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.11 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.11.0dev plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.10 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.9.2 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.9.1 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.9.0 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.8.1 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.8 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.7 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.6.1 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.6 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.6.1dev plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.5.1 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.5 plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.5.6dev plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.5.5dev plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.5.4dev plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb
redcar-0.5.3dev plugins/project/vendor/net-ftp-list/test/test_net_ftp_list_netware.rb