flowerbox-delivery/features/support/env.rb
2012-01-23 11:58:20 -05:00

38 lines
435 B
Ruby

require 'flowerbox-delivery'
require 'mocha'
require 'fakefs/safe'
World(Mocha::API)
class FakeFS::File::Stat
def file?
File.file?(@file)
end
end
Before do
mocha_setup
FakeFS.activate!
end
After do
begin
mocha_verify
ensure
mocha_teardown
end
FakeFS.deactivate!
if @running_server
@running_server[:server].shutdown
@running_server = nil
sleep 0.1
end
@server.stop if @server
end