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
drake-0.8.7.0.2.4 test/test_rake.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_rake.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_rake.rb
middleman-0.13.1 lib/middleman/vendor/gems/ruby/1.8/gems/rake-0.8.7/test/test_rake.rb
middleman-0.13.1 lib/middleman/vendor/gems/ruby/1.9.1/gems/rake-0.8.7/test/test_rake.rb
middleman-0.12.2 lib/middleman/vendor/gems/gems/rake-0.8.7/test/test_rake.rb
middleman-0.12.1 lib/middleman/vendor/gems/gems/rake-0.8.7/test/test_rake.rb
middleman-0.12.0.pre3 lib/middleman/vendor/gems/gems/rake-0.8.7/test/test_rake.rb
middleman-0.12.0.pre2 lib/middleman/vendor/gems/gems/rake-0.8.7/test/test_rake.rb
middleman-0.12.0.pre lib/middleman/vendor/gems/gems/rake-0.8.7/test/test_rake.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_rake.rb
middleman-0.10.17 vendor/gems/gems/rake-0.8.7/test/test_rake.rb
middleman-0.10.16 vendor/gems/gems/rake-0.8.7/test/test_rake.rb
middleman-0.10.15 vendor/gems/gems/rake-0.8.7/test/test_rake.rb
middleman-0.10.14 vendor/gems/gems/rake-0.8.7/test/test_rake.rb
drake-0.8.1.10.0.1 test/test_rake.rb
drake-0.8.2.0.0.2 test/test_rake.rb
drake-0.8.1.11.0.1 test/test_rake.rb
drake-0.8.1.10.0 test/test_rake.rb
drake-0.8.2.1.0.9 test/test_rake.rb