tighten up Hub and add comments
[god.git] / test / test_behavior.rb
blob50de69c690fcda558a55647e21eb82108c785895
1 require File.dirname(__FILE__) + '/helper'
3 class TestBehavior < Test::Unit::TestCase
4   def test_generate_should_return_an_object_corresponding_to_the_given_type
5     assert_equal Behaviors::FakeBehavior, Behavior.generate(:fake_behavior, nil).class
6   end
7   
8   def test_generate_should_raise_on_invalid_type
9     assert_raise NoSuchBehaviorError do
10       Behavior.generate(:foo, nil)
11     end
12   end
13   
14   def test_complain
15     Syslog.expects(:err).with('foo')
16     # Kernel.expects(:puts).with('foo')
17     no_stdout do
18       assert !Behavior.allocate.bypass.complain('foo')
19     end
20   end
21 end