diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-14 02:13:00 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-14 04:12:33 -0300 |
commit | b451de0d6de4df6bc66b274cec73b919f823d5ae (patch) | |
tree | f252c4143a0adb3be7d36d543282539cca0fb971 /actionpack/test/template/html-scanner/tokenizer_test.rb | |
parent | 1590377886820e00b1a786616518a32f3b61ec0f (diff) | |
download | rails-b451de0d6de4df6bc66b274cec73b919f823d5ae.tar.gz rails-b451de0d6de4df6bc66b274cec73b919f823d5ae.tar.bz2 rails-b451de0d6de4df6bc66b274cec73b919f823d5ae.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 |