Sha256: f3dbbb6e31b39882e5d195b51c3073af286f24ba5785e70dbbe1bba36a20ca67

Contents?: true

Size: 1017 Bytes

Versions: 125

Compression:

Stored size: 1017 Bytes

Contents

#!/usr/bin/env ruby

require 'test/unit'
require 'rake'

class TestRake < Test::Unit::TestCase
  def test_each_dir_parent
    assert_equal ['a'], alldirs('a')
    assert_equal ['a/b', 'a'], alldirs('a/b')
    assert_equal ['/a/b', '/a', '/'], alldirs('/a/b')
    if File.dirname("c:/foo") == "c:"
      # Under Unix
      assert_equal ['c:/a/b', 'c:/a', 'c:'], alldirs('c:/a/b')
      assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')
    else
      # Under Windows
      assert_equal ['c:/a/b', 'c:/a', 'c:/'], alldirs('c:/a/b')
      assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')
    end
  end

  def alldirs(fn)
    result = []
    Rake.each_dir_parent(fn) { |d| result << d }
    result
  end

  def test_can_override_application
    old_app = Rake.application
    fake_app = Object.new
    Rake.application = fake_app
    assert_equal fake_app, Rake.application
  ensure
    Rake.application = old_app
  end

  def test_original_dir_reports_current_dir
    assert_equal Dir.pwd, Rake.original_dir
  end
    
end

Version data entries

125 entries across 97 versions & 11 rubygems

Version Path
craigmarksmith-rake-0.8.3.100 test/test_rake.rb
craigmarksmith-rake-0.8.4.101 test/test_rake.rb
craigmarksmith-rake-0.8.4.102 test/test_rake.rb
craigmarksmith-rake-0.8.4.103 test/test_rake.rb
elliottcable-echoe-3.1.1 vendor/rake/test/test_rake.rb
elliottcable-echoe-3.1.2 vendor/rake/test/test_rake.rb
jimweirich-rake-0.8.1.11 test/test_rake.rb
jimweirich-rake-0.8.2.99 test/test_rake.rb
jimweirich-rake-0.8.2 test/test_rake.rb
jimweirich-rake-0.8.3.1 test/test_rake.rb
jimweirich-rake-0.8.3.100 test/test_rake.rb
jimweirich-rake-0.8.3.99 test/test_rake.rb
jimweirich-rake-0.8.3 test/test_rake.rb
jimweirich-rake-0.8.4.99 test/test_rake.rb
jimweirich-rake-0.8.5 test/test_rake.rb
luislavena-rake-0.8.3.99 test/test_rake.rb
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.7.0 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb