aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2012-02-13 17:54:58 +0900
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-20 16:14:47 -0800
commit621d2199599e9a3154ce6f6e81385bf574030f15 (patch)
treebf00e0970808b15ad79cf870e0192bf26664e3b4 /activesupport/test
parent7b73913701ff41981d166ca457e41690aac3bce3 (diff)
downloadrails-621d2199599e9a3154ce6f6e81385bf574030f15.tar.gz
rails-621d2199599e9a3154ce6f6e81385bf574030f15.tar.bz2
rails-621d2199599e9a3154ce6f6e81385bf574030f15.zip
add AS::SafeBuffer#clone_empty
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/safe_buffer_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/safe_buffer_test.rb b/activesupport/test/safe_buffer_test.rb
index db9159b289..20731218cf 100644
--- a/activesupport/test/safe_buffer_test.rb
+++ b/activesupport/test/safe_buffer_test.rb
@@ -116,4 +116,13 @@ class SafeBufferTest < ActiveSupport::TestCase
assert_not_nil dirty
assert !dirty
end
+
+ test "clone_empty returns an empty buffer" do
+ assert_equal '', ActiveSupport::SafeBuffer.new('foo').clone_empty
+ end
+
+ test "clone_empty keeps the original dirtyness" do
+ assert @buffer.clone_empty.html_safe?
+ assert !@buffer.gsub!('', '').clone_empty.html_safe?
+ end
end