test/test_soks-view.rb in Soks-1.0.1 vs test/test_soks-view.rb in Soks-1.0.2

- old
+ new

@@ -50,13 +50,17 @@ assert_equal( [['Site Index',:index]],match("Site Index B. ball") ) assert_equal( [['Site Index A.',:index_a]],match("Site Index A. ball") ) assert_equal( [['.Site Index A.',:dot_index_a]],match(".Site Index A. ball") ) end - def match( text ) + def test_do_not_match + assert_equal [], match("Oh! L'EQUIPE? C'est...", ["l'equipe"]) + end + + def match( text, do_not_match = [] ) matches = [] - @match.match( text ) { |m,p| + @match.match( text, do_not_match ) { |m,p| matches << [m,p] "$1" } matches end @@ -158,9 +162,17 @@ def test_quotes_in_title @view.revise('A "great page" of stuff','a test page','tamc2') @view.revise('test quotes in title','A "great page" of stuff','tamc2') wait_for_queue_to_empty assert_equal( %q{<p><a href='http://testsite.com/view/AGreatPageOfStuff' class='automatic'>A "great page" of stuff</a></p>},html('test quotes in title')) + end + + def test_dont_match_the_page_title + @view.revise('Ruby','a page about ruby','tamc2') + @view.revise('not ruby','a page about ruby','tamc2') + wait_for_queue_to_empty + assert_equal( %q{<p>a page about <a href='http://testsite.com/view/Ruby' class='automatic'>ruby</a></p>},html('not ruby')) + assert_equal( %q{<p>a page about ruby</p>},html('ruby')) end def test_wiki_links @view.revise('test1','[[test => a wonderfull page?great=good ]]','tamc2') @view.revise('test2','[[test => /edit/a wonderfull page?great =good ]]','tamc2') \ No newline at end of file