Sha256: def4ecd4e7f561d37d54b81a45a3425da8c860f126ee9cb89d51d083b9c8eeb1

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 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(: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 "number_of_workers defaults to 2" do
    task = DeepTest::TestTask.new do |t|
      t.stubs(:define)
    end
    assert_equal 2, task.number_of_workers
  end
  
  test "number_of_workers can be set" do
    task = DeepTest::TestTask.new do |t|
      t.number_of_workers = 42
      t.stubs(:define)
    end
    assert_equal 42, task.number_of_workers
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
deep_test-1.1.2 test/test_task_test.rb
deep_test-1.2.0 test/test_task_test.rb
deep_test-1.2.1 test/test_task_test.rb
deep_test-1.1.0 test/test_task_test.rb
deep_test-1.1.1 test/test_task_test.rb
deep_test-1.1.3 test/test_task_test.rb
deep_test-1.1.4 test/test_task_test.rb