--- handshake-0.3.0/lib/handshake.rb.orig 2008-01-09 17:32:52.000000000 -0600 +++ handshake-0.3.0/lib/handshake.rb 2008-01-09 17:49:49.000000000 -0600 @@ -300,7 +300,7 @@ message = method_specified ? mesg : meth_or_mesg condition = MethodCondition.new(message, &block) if method_specified - define_condition(type, meth_or_mesg, condition) + define_condition(meth_or_mesg, type, condition) else defer type, condition end --- handshake-0.3.0/test/tc_handshake.rb.orig 2008-01-09 17:52:42.000000000 -0600 +++ handshake-0.3.0/test/tc_handshake.rb 2008-01-09 17:59:08.000000000 -0600 @@ -361,18 +361,24 @@ before { assert false } def call_fails; end def call_passes; end + def also_fails; end + before(:also_fails) { assert false } end class ExtendsSimpleBeforeCondition < SimpleBeforeCondition; end def test_simple_before_condition - assert_equal(1, SimpleBeforeCondition.method_contracts.length) + assert_equal(2, SimpleBeforeCondition.method_contracts.length) assert_not_nil(SimpleBeforeCondition.method_contracts[:call_fails]) + assert_not_nil(SimpleBeforeCondition.method_contracts[:also_fails]) assert_violation { SimpleBeforeCondition.new.call_fails } + assert_violation { SimpleBeforeCondition.new.also_fails } assert_passes { SimpleBeforeCondition.new.call_passes } - assert_equal(1, ExtendsSimpleBeforeCondition.method_contracts.length) + assert_equal(2, ExtendsSimpleBeforeCondition.method_contracts.length) assert_not_nil(ExtendsSimpleBeforeCondition.method_contracts[:call_fails]) + assert_not_nil(ExtendsSimpleBeforeCondition.method_contracts[:also_fails]) assert_violation { ExtendsSimpleBeforeCondition.new.call_fails } assert_passes { ExtendsSimpleBeforeCondition.new.call_passes } + assert_violation { ExtendsSimpleBeforeCondition.new.also_fails } end class SimpleAfterCondition