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
drake-0.8.3.1.0.14 test/test_namespace.rb
drake-0.8.2.1.0.10 test/test_namespace.rb
drake-0.8.2.0.0.2 test/test_namespace.rb
drake-0.8.1.11.0.1 test/test_namespace.rb
drake-0.8.1.10.0 test/test_namespace.rb
drake-0.8.2.1.0.9 test/test_namespace.rb
drake-0.8.2.1.0.12 test/test_namespace.rb
drake-0.8.2.1.0.13 test/test_namespace.rb
drake-0.8.2.1.0.3 test/test_namespace.rb
drake-0.8.2.1.0.4 test/test_namespace.rb
drake-0.8.2.1.0.5 test/test_namespace.rb
drake-0.8.2.1.0.6 test/test_namespace.rb
drake-0.8.2.1.0.7 test/test_namespace.rb
drake-0.8.2.1.0.11 test/test_namespace.rb
rake-0.8.2 test/test_namespace.rb
rake-0.8.1 test/test_namespace.rb
rake-0.8.0 test/test_namespace.rb
rake-0.8.3 test/test_namespace.rb