2010-09-12 17:45:45 +00:00
|
|
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
|
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
|
|
require 'rubygems'
|
|
|
|
require 'compass'
|
2010-10-13 00:33:20 +00:00
|
|
|
require 'rspec'
|
|
|
|
require 'rspec/autorun'
|
2011-03-23 01:19:19 +00:00
|
|
|
require 'mocha'
|
2011-02-23 02:24:29 +00:00
|
|
|
|
|
|
|
module CompassGlobalInclude
|
|
|
|
class << self
|
|
|
|
def included(klass)
|
|
|
|
klass.instance_eval do
|
|
|
|
let(:images_src_path) { File.join(File.dirname(__FILE__), 'test_project', 'public', 'images') }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-29 23:26:11 +00:00
|
|
|
module CompassSpriteHelpers
|
|
|
|
def create_sprite_temp
|
|
|
|
::FileUtils.cp_r @images_src_path, @images_tmp_path
|
|
|
|
end
|
|
|
|
|
|
|
|
def clean_up_sprites
|
|
|
|
::FileUtils.rm_r @images_tmp_path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-02-23 02:24:29 +00:00
|
|
|
RSpec.configure do |config|
|
|
|
|
config.include(CompassGlobalInclude)
|
2011-03-29 23:26:11 +00:00
|
|
|
config.include(CompassSpriteHelpers)
|
|
|
|
config.before :each do
|
|
|
|
@images_src_path = File.join(File.dirname(__FILE__), 'test_project', 'public', 'images')
|
|
|
|
@images_tmp_path = File.join(File.dirname(__FILE__), 'test_project', 'public', 'images-tmp')
|
|
|
|
end
|
2011-03-23 01:19:19 +00:00
|
|
|
config.mock_with :mocha
|
2011-03-29 23:26:11 +00:00
|
|
|
end
|