aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/adv_attr_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/adv_attr_test.rb b/actionpack/test/adv_attr_test.rb
new file mode 100644
index 0000000000..fdda4ad92d
--- /dev/null
+++ b/actionpack/test/adv_attr_test.rb
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/abstract_unit'
+require 'action_mailer/adv_attr_accessor'
+
+class AdvAttrTest < Test::Unit::TestCase
+ class Person
+ include ActionMailer::AdvAttrAccessor
+ adv_attr_accessor :name
+ end
+
+ def test_adv_attr
+ bob = Person.new
+ assert_nil bob.name
+ bob.name 'Bob'
+ assert_equal 'Bob', bob.name
+
+ assert_raise(ArgumentError) {bob.name 'x', 'y'}
+ end
+
+
+end \ No newline at end of file