Changeset 4497
- Timestamp:
- 06/27/06 19:41:14 (2 years ago)
- Files:
-
- trunk/actionwebservice/CHANGELOG (modified) (1 diff)
- trunk/actionwebservice/lib/action_web_service/test_invoke.rb (modified) (1 diff)
- trunk/actionwebservice/test/test_invoke_test.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionwebservice/CHANGELOG
r4312 r4497 1 1 *SVN* 2 3 * Fix invoke_layered since api_method didn't declare :expects. Closes #4720. [Kevin Ballard <kevin@sb.org>, Kent Sibilev] 2 4 3 5 * Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.] trunk/actionwebservice/lib/action_web_service/test_invoke.rb
r4173 r4497 53 53 protocol.register_api(api) 54 54 method = api.api_methods[api_method_name.to_sym] 55 raise ArgumentError, "wrong number of arguments for rpc call (#{args.length} for #{method.expects.length})" unless args.length == method.expects.length55 raise ArgumentError, "wrong number of arguments for rpc call (#{args.length} for #{method.expects.length})" if method && method.expects && args.length != method.expects.length 56 56 protocol.encode_request(public_method_name(service_name, api_method_name), args.dup, method.expects) 57 57 end trunk/actionwebservice/test/test_invoke_test.rb
r4173 r4497 3 3 4 4 class TestInvokeAPI < ActionWebService::API::Base 5 api_method :null 5 6 api_method :add, :expects => [:int, :int], :returns => [:int] 6 7 end … … 14 15 @invoked = true 15 16 a + b 17 end 18 19 def null 16 20 end 17 21 end … … 29 33 @invoked = true 30 34 @method_params[0] + @method_params[1] 35 end 36 37 def null 31 38 end 32 39 end … … 98 105 end 99 106 107 def test_with_no_parameters_declared 108 @controller = TestInvokeDirectController.new 109 assert_nil invoke(:null) 110 end 111 100 112 end