forked from schacon/git-scribe
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
109 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
require File.expand_path "../test_helper", __FILE__ | ||
|
||
context "scribe gen tests" do | ||
setup do | ||
@scribe = GitScribe.new | ||
end | ||
|
||
test "will not respond to non-thing" do | ||
assert_raise RuntimeError do | ||
@scribe.gen('mofo') | ||
end | ||
end | ||
|
||
test "scribe can generate single page html" do | ||
in_temp_dir do | ||
@scribe.init('t') | ||
Dir.chdir('t') do | ||
file = @scribe.gen('html') | ||
assert_equal 'book.html', file | ||
out = Dir.glob('output/**/*') | ||
assert out.include? 'output/book.html' | ||
assert out.include? 'output/image' | ||
assert out.include? 'output/stylesheets/handbookish.css' | ||
end | ||
end | ||
end | ||
|
||
test "scribe can generate site html" do | ||
in_temp_dir do | ||
@scribe.init('t') | ||
Dir.chdir('t') do | ||
data = @scribe.gen('site') | ||
out = Dir.glob('output/**/*') | ||
assert out.include? 'output/index.html' | ||
assert out.include? 'output/the_first_chapter.html' | ||
assert out.include? 'output/the_second_chapter.html' | ||
assert out.include? 'output/image' | ||
assert out.include? 'output/stylesheets/handbookish.css' | ||
end | ||
end | ||
end | ||
|
||
test "scribe can generate a pdf" do | ||
in_temp_dir do | ||
@scribe.init('t') | ||
Dir.chdir('t') do | ||
data = @scribe.gen('pdf') | ||
assert_equal data, 'book.pdf' | ||
out = Dir.glob('output/**/*') | ||
assert out.include? 'output/book.pdf' | ||
end | ||
end | ||
end | ||
|
||
test "scribe can generate a epub" do | ||
in_temp_dir do | ||
@scribe.init('t') | ||
Dir.chdir('t') do | ||
data = @scribe.gen('epub') | ||
assert_equal data, 'book.epub' | ||
out = Dir.glob('output/**/*') | ||
assert out.include? 'output/book.epub' | ||
end | ||
end | ||
end | ||
|
||
xtest "scribe can generate docbook" do | ||
end | ||
|
||
xtest "scribe can generate a mobi" do | ||
end | ||
|
||
xtest "scribe can generate all" do | ||
end | ||
|
||
xtest "scribe doesn't regen already generated assets" do | ||
end | ||
end |