spec/spec_helper.rb
changeset 0 266fe36d11dd
equal deleted inserted replaced
-1:000000000000 0:266fe36d11dd
       
     1 # -*- ruby -*-
       
     2 #encoding: utf-8
       
     3 
       
     4 require 'simplecov' if ENV['COVERAGE']
       
     5 
       
     6 require 'rspec'
       
     7 
       
     8 require 'mongrel2'
       
     9 require 'mongrel2/testing'
       
    10 
       
    11 require 'thingfish'
       
    12 require 'thingfish/spechelpers'
       
    13 require 'thingfish/processor/pdf'
       
    14 
       
    15 require 'loggability/spechelpers'
       
    16 
       
    17 
       
    18 module Thingfish::Processor::PDF::SpecHelpers
       
    19 
       
    20 	FIXTURE_DIR = Pathname( __FILE__ ).dirname + 'data'
       
    21 
       
    22 
       
    23 	### Load and return the data from the fixture with the specified +filename+.
       
    24 	def fixture_data( filename )
       
    25 		fixture = FIXTURE_DIR + filename
       
    26 		return fixture.open( 'r', encoding: 'binary' )
       
    27 	end
       
    28 
       
    29 end
       
    30 
       
    31 
       
    32 
       
    33 ### Mock with RSpec
       
    34 RSpec.configure do |config|
       
    35 	config.run_all_when_everything_filtered = true
       
    36 	config.filter_run :focus
       
    37 	config.order = 'random'
       
    38 	config.mock_with( :rspec ) do |mock|
       
    39 		mock.syntax = :expect
       
    40 	end
       
    41 
       
    42 	config.include( Mongrel2::SpecHelpers )
       
    43 	config.include( Thingfish::SpecHelpers )
       
    44 	config.include( Loggability::SpecHelpers )
       
    45 	config.include( Thingfish::Processor::PDF::SpecHelpers )
       
    46 end
       
    47 
       
    48 
       
    49