More tests
OK, at least now we have some BASIC test coverage.
This commit is contained in:
parent
305b37b401
commit
bd77c75403
2 changed files with 41 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env ruby
|
||||
# encoding: UTF-8
|
||||
|
||||
require File.dirname(__FILE__) + '/../../test_helper'
|
||||
require 'chunks/wiki'
|
||||
|
@ -79,6 +80,13 @@ class WikiTest < Test::Unit::TestCase
|
|||
assert_equal %w(pagename WikiWord x), recognized_includes
|
||||
end
|
||||
|
||||
def test_redirects_chunk_pattern
|
||||
content = 'This is a [[!redirects pagename]] and [[!redirects WikiWord]] and' +
|
||||
' [[!redirects x]] and [[!redirects page name]] but [[blah]]'
|
||||
recognized_redirects = content.scan(Redirect.pattern).collect { |m| m[0] }
|
||||
assert_equal %w(pagename WikiWord x page\ name), recognized_redirects
|
||||
end
|
||||
|
||||
def test_textile_link
|
||||
textile_link = ContentStub.new('"Here is a special link":SpecialLink')
|
||||
WikiChunk::Word.apply_to(textile_link)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue