Sha256: 6d84158c7232ba3cd579db3106eeb230edb7bee449bd05acf9d31c07065da65a

Contents?: true

Size: 946 Bytes

Versions: 208

Compression:

Stored size: 946 Bytes

Contents

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

class TestRakeNameSpace < Rake::TestCase

  class TM
    include Rake::TaskManager
  end

  def test_namespace_creation
    mgr = TM.new
    ns = Rake::NameSpace.new(mgr, [])
    refute_nil ns
  end

  def test_namespace_lookup
    mgr = TM.new
    ns = mgr.in_namespace("n") do
      mgr.define_task(Rake::Task, "t")
    end

    refute_nil ns["t"]
    assert_equal mgr["n:t"], ns["t"]
  end

  def test_namespace_reports_tasks_it_owns
    mgr = TM.new
    nns = nil
    ns = mgr.in_namespace("n") do
      mgr.define_task(Rake::Task, :x)
      mgr.define_task(Rake::Task, :y)
      nns = mgr.in_namespace("nn") do
        mgr.define_task(Rake::Task, :z)
      end
    end
    mgr.in_namespace("m") do
      mgr.define_task(Rake::Task, :x)
    end

    assert_equal ["n:nn:z", "n:x", "n:y"],
      ns.tasks.map { |tsk| tsk.name }
    assert_equal ["n:nn:z"], nns.tasks.map {|t| t.name}
  end
end

Version data entries

208 entries across 162 versions & 43 rubygems

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