Sha256: 48f5f66802b532f3db1156f227577acca40ee35139b774d703491512a6a38e1c

Contents?: true

Size: 848 Bytes

Versions: 45

Compression:

Stored size: 848 Bytes

Contents

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

class TestRakeRequire < Rake::TestCase

  def test_can_load_rake_library
    app = Rake::Application.new
    assert app.instance_eval {
      rake_require("test2", ['test/data/rakelib'], [])
    }
  end

  def test_wont_reload_rake_library
    app = Rake::Application.new

    paths = ['test/data/rakelib']
    loaded_files = []
    app.rake_require("test2", paths, loaded_files)

    assert ! app.instance_eval {
      rake_require("test2", paths, loaded_files)
    }
  end

  def test_throws_error_if_library_not_found
    app = Rake::Application.new
    ex = assert_raises(LoadError) {
      assert app.instance_eval {
        rake_require("testx", ['test/data/rakelib'], [])
      }
    }
    assert_match(/(can *not|can't)\s+find/i, ex.message)
    assert_match(/testx/, ex.message)
  end
end

Version data entries

45 entries across 32 versions & 4 rubygems

Version Path
dirty_history-0.2.0 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_require.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_require.rb
search_biomodel-1.0.0 search_biomodel/ruby/1.8/gems/rake-0.9.2/test/test_rake_require.rb
rake-0.9.2 test/test_rake_require.rb
rake-0.9.1 test/test_rake_require.rb