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
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_invocation_chain.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_invocation_chain.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
gss-0.0.7 vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb
gss-0.0.6 vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb
gss-0.0.5 vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb
candlepin-api-0.4.0 bundle/ruby/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb
torquebox-console-0.3.0 vendor/bundle/jruby/1.9/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
swipe-rails-0.0.5 vendor/bundle/gems/rake-10.0.4/test/test_rake_invocation_chain.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
sshp-0.0.2 vendor/ruby/1.9.1/gems/rake-10.0.4/test/test_rake_invocation_chain.rb
sshp-0.0.1 vendor/ruby/1.9.1/gems/rake-10.0.4/test/test_rake_invocation_chain.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
vergissberlin-0.0.9 vendor/bundle/gems/rake-10.0.4/test/test_rake_invocation_chain.rb
vergissberlin-0.0.7 vendor/bundle/gems/rake-10.0.4/test/test_rake_invocation_chain.rb