Skip to content

Commit

Permalink
basic pdf and bare preso tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Sep 12, 2011
1 parent d9fb07d commit b46e889
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group :development do
gem "mg"
gem "turn"
gem "rack-test"
gem "pdf-inspector"
end

group :optional do
Expand Down
21 changes: 21 additions & 0 deletions test/bare_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require File.expand_path "../test_helper", __FILE__

context "ShowOff Bare tests" do

def app
opt = {:verbose => false, :pres_dir => "test/fixtures/bare", :pres_file => 'showoff.json'}
ShowOff.set opt
ShowOff.new
end

setup do
end

test "can get bare slides" do
get '/slides'
assert last_response.ok?
assert_equal 2, last_response.body.scan(/div class="slide"/).size
assert_match '<h1>My Bare Presentation</h1>', last_response.body
end

end
9 changes: 4 additions & 5 deletions test/basic_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require File.expand_path "../test_helper", __FILE__
require 'pdf/inspector'

context "ShowOff basic tests" do

Expand Down Expand Up @@ -41,13 +42,11 @@ def app
test "can create a pdf version" do
get '/pdf'
assert last_response.ok?
assert last_response.body.size > 5000
end

test "can create a static version" do
end
pages = PDF::Inspector::Page.analyze(last_response.body).pages.size
assert_equal 2, pages

test "can create a github version" do
assert last_response.body.size > 5000
end

end
9 changes: 9 additions & 0 deletions test/fixtures/bare/slides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
!SLIDE
# My Bare Presentation #

!SLIDE bullets incremental
# Some Bullet Points #

* first point
* second point
* third point
19 changes: 18 additions & 1 deletion test/utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@
setup do
end

test "somtehing" do
# create, init - Create new showoff presentation
test "can initialize a new preso" do
assert true
end

# add, new - Add a new slide at the end in a given dir
test "can add a new slide" do
end

# heroku - Setup your presentation to serve on Heroku
test "can herokuize" do
end

# static - Generate static version of presentation
test "can create a static version" do
end

# github - Puts your showoff presentation into a gh-pages branch
test "can create a github version" do
end
end

0 comments on commit b46e889

Please sign in to comment.