From fb63fc67fb8210fede6fea1837fd6a9c69fa499f Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sat, 12 Jan 2008 03:06:10 +0000 Subject: 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 --- actionpack/test/adv_attr_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 actionpack/test/adv_attr_test.rb (limited to 'actionpack/test') 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 -- cgit v1.2.3