-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
113 additions
and
1,422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,10 @@ def block_format(text) | |
|
||
formatted | ||
end | ||
|
||
# Access the mailer instance. | ||
def mailer #:nodoc: | ||
@controller | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,36 @@ | ||
require 'abstract_unit' | ||
require 'action_mailer/adv_attr_accessor' | ||
|
||
class AdvAttrTest < Test::Unit::TestCase | ||
class AdvAttrTest < ActiveSupport::TestCase | ||
class Person | ||
include ActionMailer::AdvAttrAccessor | ||
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 | ||
bob = Person.new | ||
assert_nil bob.name | ||
bob.name 'Bob' | ||
assert_equal 'Bob', bob.name | ||
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 | ||
|
||
assert_raise(ArgumentError) {bob.name 'x', 'y'} | ||
def test_ivar_is_added_to_protected_instnace_variables | ||
assert Person.protected_instance_variables.include?('@name') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
activesupport/lib/active_support/vendor/i18n-0.1.3/MIT-LICENSE
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
activesupport/lib/active_support/vendor/i18n-0.1.3/README.textile
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
activesupport/lib/active_support/vendor/i18n-0.1.3/i18n.gemspec
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.