aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-02-04 13:14:44 +0000
committerPratik Naik <pratiknaik@gmail.com>2010-02-04 13:14:44 +0000
commit8260f0b40f8954f1822a0f856f7c0706afbba0bd (patch)
tree1ec6fe65274eeb87c2030ba2daa3e230a375e846 /activesupport/test
parent6241d4e5535190b817e546130cfe179b641da1ba (diff)
parent6d6e6105c074eb9f266619e77a0873635af94124 (diff)
downloadrails-8260f0b40f8954f1822a0f856f7c0706afbba0bd.tar.gz
rails-8260f0b40f8954f1822a0f856f7c0706afbba0bd.tar.bz2
rails-8260f0b40f8954f1822a0f856f7c0706afbba0bd.zip
Merge remote branch 'mainstream/master'
Conflicts: railties/guides/source/3_0_release_notes.textile
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/multibyte_chars_test.rb22
-rw-r--r--activesupport/test/notifications_test.rb18
2 files changed, 12 insertions, 28 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb
index 0f68dcfe23..0e489c10e1 100644
--- a/activesupport/test/multibyte_chars_test.rb
+++ b/activesupport/test/multibyte_chars_test.rb
@@ -301,10 +301,10 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
assert_equal " #{UNICODE_STRING}", @chars.rjust(5)
assert_equal " #{UNICODE_STRING}", @chars.rjust(7)
assert_equal "---#{UNICODE_STRING}", @chars.rjust(7, '-')
- assert_equal "αα#{UNICODE_STRING}", @chars.rjust(7, 'α')
+ assert_equal "ααα#{UNICODE_STRING}", @chars.rjust(7, 'α')
assert_equal "aba#{UNICODE_STRING}", @chars.rjust(7, 'ab')
assert_equal "αηα#{UNICODE_STRING}", @chars.rjust(7, 'αη')
- assert_equal "αη#{UNICODE_STRING}", @chars.rjust(8, 'αη')
+ assert_equal "αηαη#{UNICODE_STRING}", @chars.rjust(8, 'αη')
end
def test_ljust_should_raise_argument_errors_on_bad_arguments
@@ -319,10 +319,10 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
assert_equal "#{UNICODE_STRING} ", @chars.ljust(5)
assert_equal "#{UNICODE_STRING} ", @chars.ljust(7)
assert_equal "#{UNICODE_STRING}---", @chars.ljust(7, '-')
- assert_equal "#{UNICODE_STRING}αα", @chars.ljust(7, 'α')
+ assert_equal "#{UNICODE_STRING}ααα", @chars.ljust(7, 'α')
assert_equal "#{UNICODE_STRING}aba", @chars.ljust(7, 'ab')
assert_equal "#{UNICODE_STRING}αηα", @chars.ljust(7, 'αη')
- assert_equal "#{UNICODE_STRING}αη", @chars.ljust(8, 'αη')
+ assert_equal "#{UNICODE_STRING}αηαη", @chars.ljust(8, 'αη')
end
def test_center_should_raise_argument_errors_on_bad_arguments
@@ -339,13 +339,13 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
assert_equal " #{UNICODE_STRING} ", @chars.center(7)
assert_equal "--#{UNICODE_STRING}--", @chars.center(8, '-')
assert_equal "--#{UNICODE_STRING}---", @chars.center(9, '-')
- assert_equal "α#{UNICODE_STRING}α", @chars.center(8, 'α')
- assert_equal "α#{UNICODE_STRING}αα", @chars.center(9, 'α')
- assert_equal "a#{UNICODE_STRING}", @chars.center(7, 'ab')
- assert_equal UNICODE_STRING, @chars.center(8, 'ab')
- assert_equal "ab#{UNICODE_STRING}ab", @chars.center(12, 'ab')
- assert_equal "α#{UNICODE_STRING}", @chars.center(7, 'αη')
- assert_equal UNICODE_STRING, @chars.center(8, 'αη')
+ assert_equal "αα#{UNICODE_STRING}αα", @chars.center(8, 'α')
+ assert_equal "αα#{UNICODE_STRING}ααα", @chars.center(9, 'α')
+ assert_equal "a#{UNICODE_STRING}ab", @chars.center(7, 'ab')
+ assert_equal "ab#{UNICODE_STRING}ab", @chars.center(8, 'ab')
+ assert_equal "abab#{UNICODE_STRING}abab", @chars.center(12, 'ab')
+ assert_equal "α#{UNICODE_STRING}αη", @chars.center(7, 'αη')
+ assert_equal "αη#{UNICODE_STRING}αη", @chars.center(8, 'αη')
end
def test_lstrip_strips_whitespace_from_the_left_of_the_string
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb
index 0b78b53c73..545811a376 100644
--- a/activesupport/test/notifications_test.rb
+++ b/activesupport/test/notifications_test.rb
@@ -67,29 +67,13 @@ module Notifications
end
class InstrumentationTest < TestCase
- delegate :instrument, :instrument!, :to => ActiveSupport::Notifications
+ delegate :instrument, :to => ActiveSupport::Notifications
def test_instrument_returns_block_result
assert_equal 2, instrument(:awesome) { 1 + 1 }
drain
end
- def test_instrument_with_bang_returns_result_even_on_failure
- begin
- instrument!(:awesome, :payload => "notifications") do
- raise "FAIL"
- end
- flunk
- rescue
- end
-
- drain
-
- assert_equal 1, @events.size
- assert_equal :awesome, @events.last.name
- assert_equal Hash[:payload => "notifications"], @events.last.payload
- end
-
def test_instrument_yields_the_paylod_for_further_modification
assert_equal 2, instrument(:awesome) { |p| p[:result] = 1 + 1 }
drain