Hey everyone, I am working with Hspec and I am trying to nest beforeAll functions such that I get something like this:
describe"tests"$dobeforeAllgetGlobalKeys$dodescribe"tests that use global keys"$doit"yada yada"$\GlobalKeysk->...beforeAllgetLocalKeys$dodescribe"tests that use local keys"$doit"yada yada"$\LocalKeysk->...
the problem is that I am getting this error:
• Couldn't match type '()' with 'GlobalKeys'
Expected type: hspec-core-2.7.1:Test.Hspec.Core.Spec.Monad.SpecM
GlobalKeys ()
Actual type: Spec
I assume this is because the type this type beforeAll :: IO a -> SpecWith a -> Spec
is there a common solution for this pattern i.e. every test depends on running an IO action and some result, but then a subset of the tests depend on running a different IO action and that result?
Hey everyone, I am working with Hspec and I am trying to nest beforeAll functions such that I get something like this:
the problem is that I am getting this error:
I assume this is because the type this type beforeAll :: IO a -> SpecWith a -> Spec
is there a common solution for this pattern i.e. every test depends on running an IO action and some result, but then a subset of the tests depend on running a different IO action and that result?
Nevermind, just simplified my test setup instead!