diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-14 02:13:00 -0300 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-08-14 13:17:32 +0200 |
commit | b95d6e84b00bd926b1118f6a820eca7a870b8c35 (patch) | |
tree | 0753080f3b0dabbe0b2f62abe044c24d6b4ed5c4 /actionpack/test/template/html-scanner/tokenizer_test.rb | |
parent | 36a84a4f15f29b41c7cac2f8de410055006a8a8d (diff) | |
download | rails-b95d6e84b00bd926b1118f6a820eca7a870b8c35.tar.gz rails-b95d6e84b00bd926b1118f6a820eca7a870b8c35.tar.bz2 rails-b95d6e84b00bd926b1118f6a820eca7a870b8c35.zip |
Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;)
Diffstat (limited to 'actionpack/test/template/html-scanner/tokenizer_test.rb')
-rw-r--r-- | actionpack/test/template/html-scanner/tokenizer_test.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/actionpack/test/template/html-scanner/tokenizer_test.rb b/actionpack/test/template/html-scanner/tokenizer_test.rb index a001bcbbad..bf45a7c2e3 100644 --- a/actionpack/test/template/html-scanner/tokenizer_test.rb +++ b/actionpack/test/template/html-scanner/tokenizer_test.rb @@ -29,7 +29,7 @@ class TokenizerTest < Test::Unit::TestCase tokenize "</tag>" assert_next "</tag>" end - + def test_tag_with_single_quoted_attribute tokenize %{<tag a='hello'>x} assert_next %{<tag a='hello'>} @@ -49,7 +49,7 @@ class TokenizerTest < Test::Unit::TestCase tokenize %{<tag a="hello\\"">x} assert_next %{<tag a="hello\\"">} end - + def test_tag_with_unquoted_attribute tokenize %{<tag a=hello>x} assert_next %{<tag a=hello>} @@ -59,12 +59,12 @@ class TokenizerTest < Test::Unit::TestCase tokenize %{<tag a="x < y">x} assert_next %{<tag a="x < y">} end - + def test_tag_with_gt_char_in_attribute tokenize %{<tag a="x > y">x} assert_next %{<tag a="x > y">} end - + def test_doctype_tag tokenize %{<!DOCTYPE "blah" "blah" "blah">\n <html>} assert_next %{<!DOCTYPE "blah" "blah" "blah">} @@ -90,7 +90,7 @@ class TokenizerTest < Test::Unit::TestCase assert_next %{original } assert_next %{< hello > world} end - + def test_less_than_without_matching_greater_than tokenize %{hello <span onmouseover="gotcha"\n<b>foo</b>\nbar</span>} assert_next %{hello } @@ -109,22 +109,22 @@ class TokenizerTest < Test::Unit::TestCase assert_next %{<!-- neverending...} assert_end end - + private - + def tokenize(text) @tokenizer = HTML::Tokenizer.new(text) end - + def assert_next(expected, message=nil) token = @tokenizer.next assert_equal expected, token, message end - + def assert_sequence(*expected) assert_next expected.shift until expected.empty? end - + def assert_end(message=nil) assert_nil @tokenizer.next, message end |