1 require File.dirname(__FILE__) + '/helper'
3 class BadlyImplementedCondition < PollCondition
6 class TestCondition < Test::Unit::TestCase
10 def test_generate_should_return_an_object_corresponding_to_the_given_type
11 assert_equal Conditions::ProcessRunning, Condition.generate(:process_running, nil).class
14 def test_generate_should_raise_on_invalid_type
15 assert_raise NoSuchConditionError do
16 Condition.generate(:foo, nil)
20 def test_generate_should_return_a_good_error_message_for_invalid_types
21 emsg = "No Condition found with the class name God::Conditions::FooBar"
25 Condition.generate(:foo_bar, nil)
30 assert_equal emsg, rmsg
35 def test_test_should_raise_if_not_defined_in_subclass
36 c = BadlyImplementedCondition.new
38 assert_raise AbstractMethodNotOverriddenError do