Sha256: 0478ee2381e71f619e574f6a0802c5a9c1a74362e80e76c5804f4583076a0c19

Contents?: true

Size: 1.05 KB

Versions: 209

Compression:

Stored size: 1.05 KB

Contents

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

class TestRakeInvocationChain < Rake::TestCase

  def setup
    super

    @empty = Rake::InvocationChain::EMPTY

    @first_member = "A"
    @second_member = "B"
    @one = @empty.append(@first_member)
    @two = @one.append(@second_member)
  end

  def test_append
    chain = @empty.append("A")

    assert_equal 'TOP => A', chain.to_s # HACK
  end

  def test_append_one_circular
    ex = assert_raises RuntimeError do
      @one.append(@first_member)
    end
    assert_match(/circular +dependency/i, ex.message)
    assert_match(/A.*=>.*A/, ex.message)
  end

  def test_append_two_circular
    ex = assert_raises RuntimeError do
      @two.append(@first_member)
    end
    assert_match(/A.*=>.*B.*=>.*A/, ex.message)
  end

  def test_member_eh_one
    assert @one.member?(@first_member)
  end

  def test_member_eh_two
    assert @two.member?(@first_member)
    assert @two.member?(@second_member)
  end

  def test_to_s_empty
    assert_equal "TOP", @empty.to_s
    assert_equal "TOP => A", @one.to_s
  end

end

Version data entries

209 entries across 163 versions & 43 rubygems

Version Path
dirty_history-0.3.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_invocation_chain.rb
dirty_history-0.2.0 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_invocation_chain.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/rake-0.9.2/test/test_rake_invocation_chain.rb
rake-0.9.3.beta.1 test/test_rake_invocation_chain.rb
drake-0.9.2.0.3.1 test/test_rake_invocation_chain.rb
search_biomodel-1.0.0 search_biomodel/ruby/1.8/gems/rake-0.9.2/test/test_rake_invocation_chain.rb
rake-0.9.2 test/test_rake_invocation_chain.rb
drake-0.9.1.0.3.0 test/test_rake_invocation_chain.rb
rake-0.9.1 test/test_rake_invocation_chain.rb