Sha256: fcb0c56820ba30e06b8b88ca7aff272d6519dcba36235d910b2ce96e723d2f91

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

#!/usr/local/bin/ruby
if $0 == __FILE__
  Dir.chdir File.dirname(__FILE__)+'/../'
  $:.unshift File.expand_path('../lib/')
end

require 'rio'
require 'test/unit'
require 'test/unit/testsuite'
require 'extensions/symbol'
require 'tc/testcase'
class TC_rename_assign < Test::RIO::TestCase
  @@once = false
  def self.once
    @@once = true
    rio('a').rmtree.mkpath
    rio('b').rmtree.mkpath
    make_lines_file(3,'a/f0')
    make_lines_file(2,'a/f1')
  end
  def setup
    super
    self.class.once unless @@once

    @l = []; @f = []; @d = []
    @d[0] = rio('a')
    @d[1] = rio('b')
    @f[0] = rio('a/f0')
    @f[1] = rio('a/f1')
    @l[0] = @f[0].readlines
    @l[1] = @f[1].readlines
    @d[1] < @d[0]
    @d[1] < @d[0].files[]
  end
  def test_rename_filename_shorter
    adir = rio('adir').delete!.mkdir
    rio(adir,'abcd').touch.rename.filename = 'xyz'
    p adir[]
  end
  def test_rename_filename_shorterd
    rio('tc').delete!.mkdir
    newdir = rio('tc2').delete!.mkdir
    rio('tc').rename('tc_old')
    newdir.rename.filename = 'tc'
    p smap(rio('.').to_a)
  end
end
__END__

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rio-0.3.2 test/tc/rename_assign.rb
rio-0.3.1 test/tc/rename_assign.rb
rio-0.3.3 test/tc/rename_assign.rb
rio-0.3.4 test/tc/rename_assign.rb
rio-0.3.6 test/tc/rename_assign.rb