Sha256: 247c0f5ff5368c03ed5485597b0ef264205c71d6376e26de931f1561cf37859b

Contents?: true

Size: 829 Bytes

Versions: 7

Compression:

Stored size: 829 Bytes

Contents

require 'helper'

class TestTouching < FunWith::Files::TestCase
  context "inside a tmpdir" do
    setup do
      @dir = FilePath.tmpdir
    end
    
    teardown do
      @dir.rm
      assert_equal false, @dir.directory?
    end
    
    should "touch a subdirectory" do
      @subdir = @dir.touch_dir( "Movies", "Basketball", "Shaquille" )
      assert_fwf_filepath @subdir
      assert_directory @subdir
      assert_equal @dir, @subdir.up.up.up

      @subdir_file = @dir.join( "Movies", "Basketball", "Shaquille", "JamNinja.m4v" ).touch
      
      assert_fwf_filepath @subdir_file
      assert_empty_file @subdir_file
      assert_equal @dir, @subdir_file.dirname.up.up.up
    end
    
    should "accept touch_dir on existing directory" do
      assert_nothing_raised do
        @dir.touch_dir
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fun_with_files-0.0.18 ./test/test_touching.rb
fun_with_files-0.0.15 ./test/test_touching.rb
fun_with_files-0.0.14 ./test/test_touching.rb
fun_with_files-0.0.13 ./test/test_touching.rb
fun_with_files-0.0.12 ./test/test_touching.rb
fun_with_files-0.0.9 ./test/test_touching.rb
fun_with_files-0.0.8 ./test/test_touching.rb