diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-04-05 15:41:04 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-04-05 15:41:04 +0000 |
commit | 7a5bac1de0c6a851d5e2a224629ee0a135db6bc2 (patch) | |
tree | 5d171d913d22ea07966fd82986d85c5b3e3f07e3 /actionwebservice/test/api_test.rb | |
parent | 361dcad8fd022065bc38fd557b0ec02d6e3f1a0b (diff) | |
download | rails-7a5bac1de0c6a851d5e2a224629ee0a135db6bc2.tar.gz rails-7a5bac1de0c6a851d5e2a224629ee0a135db6bc2.tar.bz2 rails-7a5bac1de0c6a851d5e2a224629ee0a135db6bc2.zip |
add API::Method#expects_index_of helper to get the index of
a named parameter
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1091 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test/api_test.rb')
-rw-r--r-- | actionwebservice/test/api_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionwebservice/test/api_test.rb b/actionwebservice/test/api_test.rb index f6d73866b7..986df47a14 100644 --- a/actionwebservice/test/api_test.rb +++ b/actionwebservice/test/api_test.rb @@ -74,6 +74,17 @@ class TC_API < Test::Unit::TestCase end end + def test_parameter_names + method = API.api_methods[:named_signature] + assert_equal 0, method.expects_index_of(:appkey) + assert_equal 1, method.expects_index_of(:publish) + assert_equal 1, method.expects_index_of('publish') + assert_equal 0, method.expects_index_of('appkey') + assert_equal -1, method.expects_index_of('blah') + assert_equal -1, method.expects_index_of(:missing) + assert_equal -1, API.api_methods[:void].expects_index_of('test') + end + def test_to_s assert_equal 'void Expects(int param0, bool param1)', APITest::API.api_methods[:expects].to_s end |