Sha256: b0eac9d3a42b27e9df46f17f84bd8c604cb7dfbf1967ed98cd1106e8cded486a

Contents?: true

Size: 1.23 KB

Versions: 150

Compression:

Stored size: 1.23 KB

Contents

#!/usr/bin/env ruby

require 'test/unit'
require 'test/filecreation'
require 'rake/contrib/sys'

class TestSys < Test::Unit::TestCase
  include FileCreation

#   def test_delete
#     create_file("testdata/a")
#     Sys.delete_all("testdata/a")
#     assert ! File.exist?("testdata/a")
#   end

#   def test_copy
#     create_file("testdata/a")
#     Sys.copy("testdata/a", "testdata/b")
#     assert File.exist?("testdata/b")
#   end

#   def test_for_files
#     test_files = ["testdata/a.pl", "testdata/c.pl", "testdata/b.rb"]
#     test_files.each { |fn| create_file(fn) }
#     list = []
#     Sys.for_files("testdata/*.pl", "testdata/*.rb") { |fn|
#       list << fn
#     }
#     assert_equal test_files.sort, list.sort
#   end

#   def test_indir
#     here = Dir.pwd
#     Sys.makedirs("testdata/dir")
#     assert_equal "#{here}/testdata/dir", Sys.indir("testdata/dir") { Dir.pwd }
#     assert_equal here, Dir.pwd
#   end

  def test_split_all
    assert_equal ['a'], Sys.split_all('a')
    assert_equal ['..'], Sys.split_all('..')
    assert_equal ['/'], Sys.split_all('/')
    assert_equal ['a', 'b'], Sys.split_all('a/b')
    assert_equal ['/', 'a', 'b'], Sys.split_all('/a/b')
    assert_equal ['..', 'a', 'b'], Sys.split_all('../a/b')
  end
end

Version data entries

150 entries across 122 versions & 11 rubygems

Version Path
craigmarksmith-rake-0.8.3.100 test/contrib/test_sys.rb
craigmarksmith-rake-0.8.4.101 test/contrib/test_sys.rb
craigmarksmith-rake-0.8.4.102 test/contrib/test_sys.rb
craigmarksmith-rake-0.8.4.103 test/contrib/test_sys.rb
elliottcable-echoe-3.1.1 vendor/rake/test/contrib/test_sys.rb
elliottcable-echoe-3.1.2 vendor/rake/test/contrib/test_sys.rb
jimweirich-rake-0.8.1.10 test/contrib/test_sys.rb
jimweirich-rake-0.8.1.11 test/contrib/test_sys.rb
jimweirich-rake-0.8.1.5 test/contrib/testsys.rb
jimweirich-rake-0.8.1.6 test/contrib/testsys.rb
jimweirich-rake-0.8.1.7 test/contrib/testsys.rb
jimweirich-rake-0.8.1.8 test/contrib/testsys.rb
jimweirich-rake-0.8.1.9 test/contrib/testsys.rb
jimweirich-rake-0.8.2.99 test/contrib/test_sys.rb
jimweirich-rake-0.8.2 test/contrib/test_sys.rb
jimweirich-rake-0.8.3.1 test/contrib/test_sys.rb
jimweirich-rake-0.8.3.100 test/contrib/test_sys.rb
jimweirich-rake-0.8.3.99 test/contrib/test_sys.rb
jimweirich-rake-0.8.3 test/contrib/test_sys.rb
jimweirich-rake-0.8.4.99 test/contrib/test_sys.rb