flowerbox-delivery/features/support/env.rb

38 lines
435 B
Ruby
Raw Normal View History

require 'flowerbox-delivery'
require 'mocha'
require 'fakefs/safe'
World(Mocha::API)
2012-01-23 16:58:20 +00:00
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