flowerbox-delivery/features/support/env.rb

38 lines
479 B
Ruby
Raw Permalink Normal View History

require 'flowerbox-delivery'
require 'mocha'
World(Mocha::API)
Before do
mocha_setup
2012-02-08 17:41:18 +00:00
FileUtils.rm_rf 'dir'
end
After do
begin
mocha_verify
ensure
mocha_teardown
end
if @running_server
@running_server[:server].shutdown
@running_server = nil
sleep 0.1
end
@server.stop if @server
2012-01-30 16:34:57 +00:00
2012-02-08 17:41:18 +00:00
FileUtils.rm_rf 'dir'
2012-01-30 16:34:57 +00:00
end
2012-02-08 17:41:18 +00:00
def temp_path_for(file)
parts = file.split('.')[0..1].join('.')
2012-01-30 16:34:57 +00:00
2012-02-08 17:41:18 +00:00
File.join('.tmp/sprockets', File.expand_path(parts))
2012-01-30 16:34:57 +00:00
end