aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/test/struct_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-11-21 15:17:04 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-11-21 15:17:04 +0000
commit9b83e3396180d0dbcb23ec3d71adb198eae7629b (patch)
tree01ea5352514acfede892ada48c58ec7f28be2a8e /actionwebservice/test/struct_test.rb
parent440f2890af5462402d1a77daaf1751a66742b974 (diff)
downloadrails-9b83e3396180d0dbcb23ec3d71adb198eae7629b.tar.gz
rails-9b83e3396180d0dbcb23ec3d71adb198eae7629b.tar.bz2
rails-9b83e3396180d0dbcb23ec3d71adb198eae7629b.zip
Ousted ActionWebService from Rails 2.0
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test/struct_test.rb')
-rw-r--r--actionwebservice/test/struct_test.rb52
1 files changed, 0 insertions, 52 deletions
diff --git a/actionwebservice/test/struct_test.rb b/actionwebservice/test/struct_test.rb
deleted file mode 100644
index f689746ee4..0000000000
--- a/actionwebservice/test/struct_test.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-
-module StructTest
- class Struct < ActionWebService::Struct
- member :id, Integer
- member :name, String
- member :items, [String]
- member :deleted, :bool
- member :emails, [:string]
- end
-end
-
-class TC_Struct < Test::Unit::TestCase
- include StructTest
-
- def setup
- @struct = Struct.new(:id => 5,
- :name => 'hello',
- :items => ['one', 'two'],
- :deleted => true,
- :emails => ['test@test.com'])
- end
-
- def test_members
- assert_equal(5, Struct.members.size)
- assert_equal(Integer, Struct.members[:id].type_class)
- assert_equal(String, Struct.members[:name].type_class)
- assert_equal(String, Struct.members[:items].element_type.type_class)
- assert_equal(TrueClass, Struct.members[:deleted].type_class)
- assert_equal(String, Struct.members[:emails].element_type.type_class)
- end
-
- def test_initializer_and_lookup
- assert_equal(5, @struct.id)
- assert_equal('hello', @struct.name)
- assert_equal(['one', 'two'], @struct.items)
- assert_equal(true, @struct.deleted)
- assert_equal(['test@test.com'], @struct.emails)
- assert_equal(5, @struct['id'])
- assert_equal('hello', @struct['name'])
- assert_equal(['one', 'two'], @struct['items'])
- assert_equal(true, @struct['deleted'])
- assert_equal(['test@test.com'], @struct['emails'])
- end
-
- def test_each_pair
- @struct.each_pair do |name, value|
- assert_equal @struct.__send__(name), value
- assert_equal @struct[name], value
- end
- end
-end