forked from Compass/compass
/
spec_helper.rb
37 lines (33 loc) · 978 Bytes
/
spec_helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'compass'
require 'rspec'
require 'rspec/autorun'
require 'mocha'
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
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
RSpec.configure do |config|
config.include(CompassGlobalInclude)
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
config.mock_with :mocha
end