Sha256: f2296a743ed163f6201c5c8b6023af6a890ee3a05fdb18812941e5ca6fc9aa5e

Contents?: true

Size: 1.59 KB

Versions: 47

Compression:

Stored size: 1.59 KB

Contents

require File.expand_path('../helper', __FILE__)
require 'fileutils'

class TestRakeDirectoryTask < Rake::TestCase
  include Rake

  def setup
    super

    Rake.rm_rf "testdata", :verbose=>false
  end

  def teardown
    Rake.rm_rf "testdata", :verbose=>false

    super
  end

  def test_directory
    desc "DESC"
    directory "testdata/a/b/c"
    assert_equal FileCreationTask, Task["testdata"].class
    assert_equal FileCreationTask, Task["testdata/a"].class
    assert_equal FileCreationTask, Task["testdata/a/b/c"].class
    assert_nil             Task["testdata"].comment
    assert_equal "DESC",   Task["testdata/a/b/c"].comment
    assert_nil             Task["testdata/a/b"].comment
    verbose(false) {
      Task['testdata/a/b'].invoke
    }
    assert File.exist?("testdata/a/b")
    assert ! File.exist?("testdata/a/b/c")
  end

  if Rake::Win32.windows?
    def test_directory_win32
      desc "WIN32 DESC"
      FileUtils.mkdir_p("testdata")
      Dir.chdir("testdata") do
        directory 'c:/testdata/a/b/c'
        assert_equal FileCreationTask, Task['c:/testdata'].class
        assert_equal FileCreationTask, Task['c:/testdata/a'].class
        assert_equal FileCreationTask, Task['c:/testdata/a/b/c'].class
        assert_nil             Task['c:/testdata'].comment
        assert_equal "WIN32 DESC",   Task['c:/testdata/a/b/c'].comment
        assert_nil             Task['c:/testdata/a/b'].comment
        verbose(false) {
          Task['c:/testdata/a/b'].invoke
        }
        assert File.exist?('c:/testdata/a/b')
        assert ! File.exist?('c:/testdata/a/b/c')
      end
    end
  end
end

Version data entries

47 entries across 34 versions & 5 rubygems

Version Path
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.7.0 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.6.7 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.6.6 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.6.5 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.6.4 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.6.3 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.6.2 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.6.1 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.6.0 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.5.4 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.5.3 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.5.2 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.5.2 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.5.1 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.5.1 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.5.0 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb
dirty_history-0.5.0 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_directory_task.rb