start work on formatted_page
This commit is contained in:
+5
-1
@@ -11,7 +11,11 @@ require 'gollum'
|
||||
|
||||
# Make sure we're in the test dir, the tests expect that to be the current
|
||||
# directory.
|
||||
Dir.chdir(File.join(File.dirname(__FILE__), *%w[.]))
|
||||
TEST_DIR = File.join(File.dirname(__FILE__), *%w[.])
|
||||
|
||||
def testpath(path)
|
||||
File.join(TEST_DIR, path)
|
||||
end
|
||||
|
||||
# test/spec/mini 3
|
||||
# http://gist.github.com/25455
|
||||
|
||||
+8
-2
@@ -2,10 +2,16 @@ require 'helper'
|
||||
|
||||
context "Page" do
|
||||
setup do
|
||||
@repo = Gollum::Repo.new("examples/lotr.git")
|
||||
@wiki = Gollum::Wiki.new(testpath("examples/lotr.git"))
|
||||
end
|
||||
|
||||
test "formatted page" do
|
||||
page = @repo.formatted_page('Bilbo-Baggins')
|
||||
page = @wiki.formatted_page('Bilbo Baggins')
|
||||
assert_equal Gollum::Page, page.class
|
||||
assert page.data =~ /^# Bilbo Baggins\n\nBilbo Baggins/
|
||||
end
|
||||
|
||||
test "no page match" do
|
||||
assert_nil @wiki.formatted_page('I do not exist')
|
||||
end
|
||||
end
|
||||
@@ -1,12 +1,12 @@
|
||||
require 'helper'
|
||||
|
||||
context "Repo" do
|
||||
context "Wiki" do
|
||||
setup do
|
||||
@repo = Gollum::Repo.new("examples/lotr.git")
|
||||
@repo = Gollum::Wiki.new(testpath("examples/lotr.git"))
|
||||
end
|
||||
|
||||
test "repo path" do
|
||||
assert_equal "examples/lotr.git", @repo.path
|
||||
assert_equal testpath("examples/lotr.git"), @repo.path
|
||||
end
|
||||
|
||||
test "git repo" do
|
||||
Reference in New Issue
Block a user