diff options
author | Brian Cardarella <bcardarella@gmail.com> | 2011-07-29 13:06:45 -0400 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:24 -0700 |
commit | 9d5340e7094444a35c48035d9f111617806d519c (patch) | |
tree | 9476444d77d09587cff9ce7fb150368b788a7ecc /activesupport/test | |
parent | 1deb0253aee8ea96eaa118dba7cf8eaa42dcbeba (diff) | |
download | rails-9d5340e7094444a35c48035d9f111617806d519c.tar.gz rails-9d5340e7094444a35c48035d9f111617806d519c.tar.bz2 rails-9d5340e7094444a35c48035d9f111617806d519c.zip |
Reset @dirty to false when slicing an instance of SafeBuffer
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/safe_buffer_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/safe_buffer_test.rb b/activesupport/test/safe_buffer_test.rb index 7662e9b765..8f77999d25 100644 --- a/activesupport/test/safe_buffer_test.rb +++ b/activesupport/test/safe_buffer_test.rb @@ -106,4 +106,10 @@ class SafeBufferTest < ActiveSupport::TestCase test "should not fail if the returned object is not a string" do assert_kind_of NilClass, @buffer.slice("chipchop") end + + test "Should initialize @dirty to false for new instance when sliced" do + dirty = @buffer[0,0].send(:dirty?) + assert_not_nil dirty + assert !dirty + end end |