You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often a set of tests has some common setup and teardown code you want to run for each test. It would be great to be able to do something like:
module TestMyModule
@setup begin
obj = SomeObj()
obj.times_called = 0
end
facts() do
# setup block runs here
run_my_func(obj)
@fact obj.times_called = 1
# teardown block runs here
end
end # module TestMyModule
I think that it would make sense that @setup block defined at the module scope would be run for each facts block, and @setup defined inside a facts block would apply to each context
Often a set of tests has some common setup and teardown code you want to run for each test. It would be great to be able to do something like:
I think that it would make sense that
@setupblock defined at the module scope would be run for eachfactsblock, and@setupdefined inside afactsblock would apply to eachcontext