diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-04-02 21:03:36 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-04-02 21:03:36 +0000 |
commit | aaea48fe9826b9e5d2d5b92795a297b8f238c58d (patch) | |
tree | e7c01c7f95d467f837c1f96d58dac74c3c902610 /actionwebservice/test/api_test.rb | |
parent | aa09c770e9b5400683be11952673017295246de7 (diff) | |
download | rails-aaea48fe9826b9e5d2d5b92795a297b8f238c58d.tar.gz rails-aaea48fe9826b9e5d2d5b92795a297b8f238c58d.tar.bz2 rails-aaea48fe9826b9e5d2d5b92795a297b8f238c58d.zip |
* collapse 'ws' back into protocols, it just added complexity and indirection, and was hard to extend.
* extract casting into seperate support file
* ensure casting always does the right thing for return values, should fix interoperability issues with Ecto and possibly other XML-RPC clients
* add functional unit tests for scaffolding
* represent signature items with classes instead of symbols/Class objects, much more flexible
* tweak logging to always show casted versions of parameters and return values, if possible.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1072 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test/api_test.rb')
-rw-r--r-- | actionwebservice/test/api_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/actionwebservice/test/api_test.rb b/actionwebservice/test/api_test.rb index 4a61ae8de7..f6d73866b7 100644 --- a/actionwebservice/test/api_test.rb +++ b/actionwebservice/test/api_test.rb @@ -37,17 +37,17 @@ class TC_API < Test::Unit::TestCase def test_signature_canonicalization assert_equal(nil, API.api_methods[:void].expects) assert_equal(nil, API.api_methods[:void].returns) - assert_equal([String], API.api_methods[:expects_and_returns].expects) - assert_equal([String], API.api_methods[:expects_and_returns].returns) - assert_equal([Integer, TrueClass], API.api_methods[:expects].expects) + assert_equal([String], API.api_methods[:expects_and_returns].expects.map{|x| x.type_class}) + assert_equal([String], API.api_methods[:expects_and_returns].returns.map{|x| x.type_class}) + assert_equal([Integer, TrueClass], API.api_methods[:expects].expects.map{|x| x.type_class}) assert_equal(nil, API.api_methods[:expects].returns) assert_equal(nil, API.api_methods[:returns].expects) - assert_equal([Integer, [String]], API.api_methods[:returns].returns) - assert_equal([{:appkey=>Integer}, {:publish=>TrueClass}], API.api_methods[:named_signature].expects) + assert_equal([Integer, [String]], API.api_methods[:returns].returns.map{|x| x.array?? [x.element_type.type_class] : x.type_class}) + assert_equal([[:appkey, Integer], [:publish, TrueClass]], API.api_methods[:named_signature].expects.map{|x| [x.name, x.type_class]}) assert_equal(nil, API.api_methods[:named_signature].returns) - assert_equal([Integer, String, TrueClass], API.api_methods[:string_types].expects) + assert_equal([Integer, String, TrueClass], API.api_methods[:string_types].expects.map{|x| x.type_class}) assert_equal(nil, API.api_methods[:string_types].returns) - assert_equal([TrueClass, Integer, String], API.api_methods[:class_types].expects) + assert_equal([TrueClass, Integer, String], API.api_methods[:class_types].expects.map{|x| x.type_class}) assert_equal(nil, API.api_methods[:class_types].returns) end @@ -75,6 +75,6 @@ class TC_API < Test::Unit::TestCase end def test_to_s - assert_equal 'void Expects(int p1, bool p2)', APITest::API.api_methods[:expects].to_s + assert_equal 'void Expects(int param0, bool param1)', APITest::API.api_methods[:expects].to_s end end |