| | 90 | def test_31_action_function_symbol_arg |
| | 91 | printTestHeader "Applet: Define actions via action() function (Symbol arg)" |
| | 92 | rval = meow = nil |
| | 93 | |
| | 94 | # Definition only |
| | 95 | assert_nothing_raised { |
| | 96 | @appletClass.instance_eval { |
| | 97 | action( :woof ) { "woof" } |
| | 98 | } |
| | 99 | } |
| | 100 | |
| | 101 | assert_has_instance_method @appletClass, :woof_action |
| | 102 | |
| | 103 | # With Proxy |
| | 104 | assert_nothing_raised { |
| | 105 | @appletClass.instance_eval { |
| | 106 | meow = action(:meow) {"meow"} |
| | 107 | meow.template = 'one.tmpl' |
| | 108 | } |
| | 109 | } |
| | 110 | |
| | 111 | assert_instance_of Arrow::Applet::SigProxy, meow |
| | 112 | assert_has_instance_method @appletClass, :meow_action |
| | 113 | assert_not_nil @appletClass.signature[:templates][:meow], "signature entries missing" |
| | 114 | assert_equal 'one.tmpl', @appletClass.signature[:templates][:meow] |
| | 115 | end |
| | 116 | |
| | 117 | |