aboutsummaryrefslogblamecommitdiffstats
path: root/actionmailer/test/adv_attr_test.rb
blob: fd909a56276705be1d916606a2d9a7ca3ed26752 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
                       















                                                   
   
require '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