aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorNick <nick@nicksieger.com>2008-04-19 10:18:02 -0500
committerNick Sieger <nick@nicksieger.com>2008-08-29 14:12:09 -0500
commit9dc4f6611043d032e576d93430cd29efc8864bc4 (patch)
tree69473e5bbc8a4059a94c55ddac4eacb45180c1ca /activesupport/test
parent3eb68248e0c0495c4533792260c9262fcd2840af (diff)
downloadrails-9dc4f6611043d032e576d93430cd29efc8864bc4.tar.gz
rails-9dc4f6611043d032e576d93430cd29efc8864bc4.tar.bz2
rails-9dc4f6611043d032e576d93430cd29efc8864bc4.zip
Add method punctuation handling to #synchronize
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/module/synchronization_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/module/synchronization_test.rb b/activesupport/test/core_ext/module/synchronization_test.rb
index 78be6b725f..fe0f3b1a3b 100644
--- a/activesupport/test/core_ext/module/synchronization_test.rb
+++ b/activesupport/test/core_ext/module/synchronization_test.rb
@@ -54,4 +54,18 @@ class SynchronizationTest < Test::Unit::TestCase
@instance.to_s
assert_equal 2, dummy.sync_count
end
+
+ def test_can_synchronize_method_with_punctuation
+ @target.module_eval do
+ def dangerous?
+ @dangerous
+ end
+ def dangerous!
+ @dangerous = true
+ end
+ end
+ @target.synchronize :dangerous?, :dangerous!, :with => :mutex
+ @instance.dangerous!
+ assert @instance.dangerous?
+ end
end \ No newline at end of file