lib/jasper-rails.rb in jasper-rails-0.1.0 vs lib/jasper-rails.rb in jasper-rails-0.1.1

- old
+ new

@@ -1,11 +1,11 @@ require "jasper-rails/version" require "rails" require "rjb" -require "rspec" -require "pdf/inspector" +Mime::Type.register "application/pdf", :pdf + module JasperRails classpath = '.' Dir["#{File.dirname(__FILE__)}/java/*.jar"].each do |jar| classpath << File::PATH_SEPARATOR + File.expand_path(jar) @@ -85,21 +85,6 @@ controller.send_data Jasper::Rails::render_pdf(jasper_file, resource, params, options), :type => Mime::PDF end end -end - -RSpec::Matchers.define :contain do |string| - match do |response| - @pdf = PDF::Inspector::Text::analyze(response.body) - @pdf.strings.include? string - end - - failure_message_for_should do |response| - "expected that the PDF text would contain #{expected}. It only contains: #{@pdf.strings.to_s}" - end - - failure_message_for_should_not do |response| - "expected that the PDF text would not contain #{expected}. But it does: #{@pdf.strings.to_s}" - end end