Sha256: c20c28a827da6ab36faa72d172f0530e1ace6f86690a994684a3e6b95f9f668a

Contents?: true

Size: 1.08 KB

Versions: 5

Compression:

Stored size: 1.08 KB

Contents

require File.dirname(__FILE__) + "/test_helper"

unit_tests do
  test "defines a rake task with the name passed to the constructor" do
    DeepTest::TestTask.any_instance.stubs(:desc)
    DeepTest::TestTask.any_instance.expects(:task).with { |hash| hash.keys == [:my_task_name] }
    DeepTest::TestTask.new :my_task_name do
    end
  end
  
  test "setting pattern" do
    pattern = "test/**/x*_test.rb"
    task = DeepTest::TestTask.new do |t|
      t.stubs(:define)
      t.pattern = pattern
    end
    assert_equal pattern, task.pattern[-pattern.size..-1]
  end
  
  test "default pattern is test/**/*_test.rb" do
    task = DeepTest::TestTask.new do |t|
      t.stubs(:define)
    end
    assert_equal "test/**/*_test.rb", task.pattern[-"test/**/*_test.rb".size..-1]
  end
  
  test "processes defaults to 2" do
    task = DeepTest::TestTask.new do |t|
      t.stubs(:define)
    end
    assert_equal 2, task.processes
  end
  
  test "processes can be set" do
    task = DeepTest::TestTask.new do |t|
      t.processes = 42
      t.stubs(:define)
    end
    assert_equal 42, task.processes
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
deep_test-1.0.2 test/test_task_test.rb
deep_test-1.0.0 test/test_task_test.rb
deep_test-1.0.1 test/test_task_test.rb
deep_test-1.0.3 test/test_task_test.rb
deep_test-1.0.4 test/test_task_test.rb