spec/spec_helper.rb
author Mahlon E. Smith <mahlon@laika.com>
Wed, 16 Nov 2016 13:22:21 -0800
changeset 2 bef152286d42
parent 0 266fe36d11dd
permissions -rw-r--r--
Added tag v0.1.0 for changeset 70dba2d6deb8

# -*- ruby -*-
#encoding: utf-8

require 'simplecov' if ENV['COVERAGE']

require 'rspec'

require 'mongrel2'
require 'mongrel2/testing'

require 'thingfish'
require 'thingfish/spechelpers'
require 'thingfish/processor/pdf'

require 'loggability/spechelpers'


module Thingfish::Processor::PDF::SpecHelpers

	FIXTURE_DIR = Pathname( __FILE__ ).dirname + 'data'


	### Load and return the data from the fixture with the specified +filename+.
	def fixture_data( filename )
		fixture = FIXTURE_DIR + filename
		return fixture.open( 'r', encoding: 'binary' )
	end

end



### Mock with RSpec
RSpec.configure do |config|
	config.run_all_when_everything_filtered = true
	config.filter_run :focus
	config.order = 'random'
	config.mock_with( :rspec ) do |mock|
		mock.syntax = :expect
	end

	config.include( Mongrel2::SpecHelpers )
	config.include( Thingfish::SpecHelpers )
	config.include( Loggability::SpecHelpers )
	config.include( Thingfish::Processor::PDF::SpecHelpers )
end