more fun stuff

This commit is contained in:
John Bintz 2012-06-12 14:17:30 -04:00
parent 7c843ee688
commit 8a1f30f76d
4 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,15 @@
# Enable FakeFS support in scenarios tagged @fakefs
require 'fakefs/safe'
Before('@fakefs') do
FakeFS.activate!
end
After('@fakefs') do
ensure_mocha if respond_to?(:ensure_mocha)
FakeFS::FileSystem.clear
FakeFS.deactivate!
end

View File

@ -2,7 +2,7 @@
# promote reusability! # promote reusability!
flay_exception = nil flay_exception = nil
flay_level = 32 if flay_level == nil flay_level ||= 30
# set me to a minimum sane level. don't go nuts refactoring! # set me to a minimum sane level. don't go nuts refactoring!
# code should be cleaner when you're done, not become spaghetti. # code should be cleaner when you're done, not become spaghetti.

View File

@ -0,0 +1,26 @@
# Enable mocha in scenarios tagged @mocha
require 'mocha'
World(Mocha::Standalone)
def ensure_mocha
return if @_mocha_ensured
begin
mocha_verify
ensure
mocha_teardown
end
@_mocha_ensured = true
end
Before('@mocha') do
mocha_setup
end
After('@mocha') do
ensure_mocha
end

View File

@ -18,3 +18,6 @@ flay_level = 32
require 'cuke-pack/support/flay' require 'cuke-pack/support/flay'
# require 'cuke-pack/support/fakefs'
# require 'cuke-pack/support/mocha'