From 827fcf453e6e81e5d95900aecbce06bb8dc59c54 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 8 Sep 2011 05:02:47 -0700 Subject: this should have gone with the previous commit --- activesupport/lib/active_support/core_ext/string/output_safety.rb | 8 ++++---- activesupport/test/safe_buffer_test.rb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index 9f5cab6487..f364a42354 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -158,17 +158,17 @@ module ActiveSupport #:nodoc: UNAVAILABLE_STRING_METHODS.each do |unavailable_method| class_eval <<-EOT, __FILE__, __LINE__ # def gsub(*args) - # raise NoMethodError, "gsub cannot be used with a safe string. You should use object.to_str.gsub." + # raise NoMethodError, "gsub cannot be used with a safe string. You should use object.to_str.gsub" # end def #{unavailable_method}(*args) - raise NoMethodError, "#{unavailable_method} cannot be used with a safe string. You should use object.to_str.#{unavailable_method}." + raise NoMethodError, "#{unavailable_method} cannot be used with a safe string. You should use object.to_str.#{unavailable_method}" end # def gsub!(*args) - # raise NoMethodError, "gsub! cannot be used with a safe string. You should use object.to_str.gsub!." + # raise NoMethodError, "gsub! cannot be used with a safe string. You should use object.to_str.gsub!" # end def #{unavailable_method}!(*args) - raise NoMethodError, "#{unavailable_method}! cannot be used with a safe string. You should use object.to_str.#{unavailable_method}!." + raise NoMethodError, "#{unavailable_method}! cannot be used with a safe string. You should use object.to_str.#{unavailable_method}!" end EOT end diff --git a/activesupport/test/safe_buffer_test.rb b/activesupport/test/safe_buffer_test.rb index f8fcd44ef8..f2cd67749a 100644 --- a/activesupport/test/safe_buffer_test.rb +++ b/activesupport/test/safe_buffer_test.rb @@ -114,13 +114,13 @@ class SafeBufferTest < ActiveSupport::TestCase ["gsub", "sub"].each do |unavailable_method| test "should raise on #{unavailable_method}" do - assert_raise NoMethodError, "#{unavailable_method} cannot be used with a Safe Buffer object. You should use object.to_str.#{unavailable_method}" do + assert_raise NoMethodError, "#{unavailable_method} cannot be used with a safe string. You should use object.to_str.#{unavailable_method}" do @buffer.send(unavailable_method, '', '<>') end end test "should raise on #{unavailable_method}!" do - assert_raise NoMethodError, "#{unavailable_method}! cannot be used with a Safe Buffer object. You should use object.to_str.#{unavailable_method}!" do + assert_raise NoMethodError, "#{unavailable_method}! cannot be used with a safe string. You should use object.to_str.#{unavailable_method}!" do @buffer.send("#{unavailable_method}!", '', '<>') end end -- cgit v1.2.3