diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-01-12 03:06:10 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-01-12 03:06:10 +0000 |
commit | fb63fc67fb8210fede6fea1837fd6a9c69fa499f (patch) | |
tree | 3dca66629e609cb4bc4d57490b24a419a5b760f9 /actionpack/test | |
parent | eff27ab11962aa90885653438d0d04d3136fd846 (diff) | |
download | rails-fb63fc67fb8210fede6fea1837fd6a9c69fa499f.tar.gz rails-fb63fc67fb8210fede6fea1837fd6a9c69fa499f.tar.bz2 rails-fb63fc67fb8210fede6fea1837fd6a9c69fa499f.zip |
Add some tests for adv_attr_accessor. Closes #10633 [fcheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8632 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/adv_attr_test.rb | 20 |
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 |