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
rake-10.0.4 test/test_rake_invocation_chain.rb
vagrant-actionio-0.0.9 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
torquebox-console-0.2.4 vendor/bundle/ruby/1.8/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
torquebox-console-0.2.4 vendor/bundle/jruby/1.9/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
torquebox-console-0.2.3 vendor/bundle/jruby/1.9/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
active_mailer-0.0.5 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.4 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.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
remq-0.0.4 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
remq-0.0.3 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
graphael-on-rails-0.5.1 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
graphael-on-rails-0.0.1 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
challah-0.9.1.beta.3 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
devise_sociable-0.1.0 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
simple-client-0.0.3 vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb
backbone-queryparams-rails-0.0.1 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
railscast-assets-0.0.2 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
railscast-assets-0.0.2 vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/rake-10.0.3/test/test_rake_invocation_chain.rb