Permalink
Browse files

use Rack::Test instead of Sinatra::Test

  • Loading branch information...
1 parent 7db3b5a commit 88a9592609d8f978a123695bab121c01eac0d7c1 S. Brent Faulkner committed Apr 29, 2009
Showing with 18 additions and 12 deletions.
  1. +4 −0 CHANGES
  2. +1 −1 TODO
  3. +1 −1 VERSION.yml
  4. +2 −2 sinatra-prawn.gemspec
  5. +6 −6 test/sinatra_prawn_test.rb
  6. +4 −2 test/test_helper.rb
View
4 CHANGES
@@ -1,3 +1,7 @@
+= 0.9.2.1
+
+* use Rake::Test instead of Sinatra::Test
+
= 0.9.2 / unreleased
* This version is compatible with the Sinatra 0.9.2 release candidate.
View
2 TODO
@@ -1,3 +1,3 @@
= TODO
-* Switch to Rack::Test
+* view/render refactoring for sinatra
View
2 VERSION.yml
@@ -1,4 +1,4 @@
---
:major: 0
:minor: 9
-:patch: 2
+:patch: 2.1
View
4 sinatra-prawn.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{sinatra-prawn}
- s.version = "0.9.2"
+ s.version = "0.9.2.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["S. Brent Faulkner"]
- s.date = %q{2009-04-28}
+ s.date = %q{2009-04-29}
s.description = %q{Sinatra extension to add support for pdf rendering with Prawn templates.}
s.email = %q{brentf@unwwwired.net}
s.extra_rdoc_files = [
View
12 test/sinatra_prawn_test.rb
@@ -12,8 +12,8 @@ def prawn_app(&block)
def test_renders_inline_strings
prawn_app { prawn 'pdf.text "Hello shrimp!"' }
- assert ok?
- text = PDF::TextInspector.analyze(body)
+ assert last_response.ok?
+ text = PDF::TextInspector.analyze(last_response.body)
assert_equal "Hello shrimp!", text.strings.first
end
@@ -24,8 +24,8 @@ def test_renders_inline_blocks
pdf.text "Hello #{@name}!"
end
}
- assert ok?
- text = PDF::TextInspector.analyze(body)
+ assert last_response.ok?
+ text = PDF::TextInspector.analyze(last_response.body)
assert_equal "Hello Frank & Mary!", text.strings.first
end
@@ -34,8 +34,8 @@ def test_renders_prawn_files_in_views_path
@name = "World"
prawn :hello
}
- assert ok?
- text = PDF::TextInspector.analyze(body)
+ assert last_response.ok?
+ text = PDF::TextInspector.analyze(last_response.body)
assert_equal "Hello, World!", text.strings.first
end
View
6 test/test_helper.rb
@@ -1,6 +1,6 @@
require 'rubygems'
require 'test/unit'
-require 'sinatra/test'
+require 'rack/test'
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'sinatra/prawn'
@@ -52,7 +52,9 @@ def self.parse(obj)
end
class Test::Unit::TestCase
- include Sinatra::Test
+ include Rack::Test::Methods
+
+ attr_reader :app
# Sets up a Sinatra::Base subclass defined with the block
# given. Used in setup or individual spec methods to establish

0 comments on commit 88a9592

Please sign in to comment.