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
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.8.7/test/test_rake.rb
dirty_history-0.4.10 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.10 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.10 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.9 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.9 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.9 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.8 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.8 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.8 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.7 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.7 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.7 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.6 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.6 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.6 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.5 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.5 dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.5 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
dirty_history-0.4.4 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb