Sha256: c0f061323677d3bd7c0be2a057e86984226f2d409b0938331243fd5eaeaca657

Contents?: true

Size: 790 Bytes

Versions: 38

Compression:

Stored size: 790 Bytes

Contents

#!/usr/bin/env ruby

begin
  require 'rubygems'
rescue LoadError
  # got no gems
end

require 'test/unit'
require 'flexmock/test_unit'
require 'rake'

class TestNameSpace < Test::Unit::TestCase

  def test_namespace_creation
    mgr = flexmock("TaskManager")
    ns = Rake::NameSpace.new(mgr, [])
    assert_not_nil ns
  end

  def test_namespace_lookup
    mgr = flexmock("TaskManager")
    mgr.should_receive(:lookup).with(:t, ["a"]).
      and_return(:dummy).once
    ns = Rake::NameSpace.new(mgr, ["a"])
    assert_equal :dummy, ns[:t]
  end

  def test_namespace_reports_tasks_it_owns
    mgr = flexmock("TaskManager")
    mgr.should_receive(:tasks).with().
      and_return([:x, :y, :z]).once
    ns = Rake::NameSpace.new(mgr, ["a"])
    assert_equal [:x, :y, :z], ns.tasks
  end
end

Version data entries

38 entries across 38 versions & 5 rubygems

Version Path
elliottcable-echoe-3.1.1 vendor/rake/test/test_namespace.rb
elliottcable-echoe-3.1.2 vendor/rake/test/test_namespace.rb
jimweirich-rake-0.8.1.10 test/test_namespace.rb
jimweirich-rake-0.8.1.11 test/test_namespace.rb
jimweirich-rake-0.8.1.5 test/test_namespace.rb
jimweirich-rake-0.8.1.6 test/test_namespace.rb
jimweirich-rake-0.8.1.7 test/test_namespace.rb
jimweirich-rake-0.8.1.8 test/test_namespace.rb
jimweirich-rake-0.8.1.9 test/test_namespace.rb
jimweirich-rake-0.8.2.99 test/test_namespace.rb
jimweirich-rake-0.8.2 test/test_namespace.rb
jimweirich-rake-0.8.3.1 test/test_namespace.rb
jimweirich-rake-0.8.3 test/test_namespace.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_namespace.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_namespace.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_namespace.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_namespace.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_namespace.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rake-0.8.3/test/test_namespace.rb
drake-0.8.1.10.0.1 test/test_namespace.rb