mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-31 17:58:29 -05:00
Post.url
This commit is contained in:
@@ -22,6 +22,10 @@ module AutoBlog
|
||||
self.slug = slug
|
||||
self.ext = ext
|
||||
end
|
||||
|
||||
def url
|
||||
self.date.strftime("/%Y/%m/%d/") + self.slug
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -10,7 +10,7 @@ class TestPost < Test::Unit::TestCase
|
||||
assert !Post.valid?("blah")
|
||||
end
|
||||
|
||||
def test_site_init
|
||||
def test_process
|
||||
p = Post.allocate
|
||||
p.process("2008-10-19-foo-bar.textile")
|
||||
|
||||
@@ -18,4 +18,11 @@ class TestPost < Test::Unit::TestCase
|
||||
assert_equal "foo-bar", p.slug
|
||||
assert_equal "textile", p.ext
|
||||
end
|
||||
|
||||
def test_url
|
||||
p = Post.allocate
|
||||
p.process("2008-10-19-foo-bar.textile")
|
||||
|
||||
assert_equal "/2008/10/19/foo-bar", p.url
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user