diff options
author | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-24 19:36:42 +0100 |
---|---|---|
committer | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-24 19:36:42 +0100 |
commit | bd96614101262e0ad0cc176ed8e2d95a5c17936b (patch) | |
tree | 1612a3baaf634bd180b2b145db12b7eeb3096010 /actionmailer/test/old_base/adv_attr_test.rb | |
parent | 99f960a3d73b62a957988bbee0906264f35afc2e (diff) | |
download | rails-bd96614101262e0ad0cc176ed8e2d95a5c17936b.tar.gz rails-bd96614101262e0ad0cc176ed8e2d95a5c17936b.tar.bz2 rails-bd96614101262e0ad0cc176ed8e2d95a5c17936b.zip |
Move old tests to a specific folder and add some delivery method tests.
Diffstat (limited to 'actionmailer/test/old_base/adv_attr_test.rb')
-rw-r--r-- | actionmailer/test/old_base/adv_attr_test.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/actionmailer/test/old_base/adv_attr_test.rb b/actionmailer/test/old_base/adv_attr_test.rb new file mode 100644 index 0000000000..f22d733bc5 --- /dev/null +++ b/actionmailer/test/old_base/adv_attr_test.rb @@ -0,0 +1,36 @@ +require 'abstract_unit' +require 'action_mailer/adv_attr_accessor' + +class AdvAttrTest < ActiveSupport::TestCase + class Person + cattr_reader :protected_instance_variables + @@protected_instance_variables = [] + + extend ActionMailer::AdvAttrAccessor + adv_attr_accessor :name + end + + def setup + @person = Person.new + end + + def test_adv_attr + assert_nil @person.name + @person.name 'Bob' + assert_equal 'Bob', @person.name + end + + def test_adv_attr_writer + assert_nil @person.name + @person.name = 'Bob' + assert_equal 'Bob', @person.name + end + + def test_raise_an_error_with_multiple_args + assert_raise(ArgumentError) { @person.name('x', 'y') } + end + + def test_ivar_is_added_to_protected_instnace_variables + assert Person.protected_instance_variables.include?('@name') + end +end |