aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/test_test.rb
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2007-05-08 06:27:10 +0000
committerMarcel Molina <marcel@vernix.org>2007-05-08 06:27:10 +0000
commit2b6ad48ea3c80e693b3c92f90432c790c8ee1510 (patch)
treecdec6c1c0aa475db1482ac9728f34e2b4bd95a2d /activesupport/test/test_test.rb
parent388f504f6d8c7def28eb88d7f62c9267600e0f56 (diff)
downloadrails-2b6ad48ea3c80e693b3c92f90432c790c8ee1510.tar.gz
rails-2b6ad48ea3c80e693b3c92f90432c790c8ee1510.tar.bz2
rails-2b6ad48ea3c80e693b3c92f90432c790c8ee1510.zip
Evaluate expression for assert_difference in the scope of the block
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/test_test.rb')
-rw-r--r--activesupport/test/test_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/test_test.rb b/activesupport/test/test_test.rb
index d8a02b5497..e29534ccaf 100644
--- a/activesupport/test/test_test.rb
+++ b/activesupport/test/test_test.rb
@@ -46,4 +46,11 @@ class AssertDifferenceTest < Test::Unit::TestCase
@object.decrement
end
end
+
+ def test_expression_is_evaluated_in_the_appropriate_scope
+ local_scope = 'foo'
+ assert_difference 'local_scope; @object.num' do
+ @object.increment
+ end
+ end
end