Skip to content

Commit

Permalink
Make test placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
Renegatto committed Sep 5, 2024
1 parent 0803787 commit c7d664a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
2 changes: 2 additions & 0 deletions cem-script.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ test-suite cem-sdk-test
, clb
, dependent-map
, hspec
, hspec-core
, QuickCheck
, quickcheck-dynamic
, random
Expand All @@ -199,5 +200,6 @@ test-suite cem-sdk-test
Oura.Communication
Oura.Config
OuraFilters
OuraFilters.Auction

main-is: Main.hs
21 changes: 6 additions & 15 deletions test/OuraFilters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ module OuraFilters (ouraFiltersSpec) where
import Prelude
import Oura (Oura (send, receive, shutDown))
import Oura qualified
import Test.Hspec (Spec, it, shouldBe, describe)
import Test.Hspec (Spec, it, focus, shouldBe, describe)
import Control.Monad ((>=>))
import qualified Data.Text as T
import qualified Data.Text.IO as T.IO
import Utils qualified
import qualified Data.Aeson.Types as Aeson
import qualified Data.Aeson as Aeson
import Data.Aeson ((.:))
import OuraFilters.Auction qualified

exampleTx :: IO T.Text
exampleTx = T.IO.readFile "./mock/tx.json"
exampleTx = T.IO.readFile "./mocks/tx.json"

exampleMatchingTx :: IO T.Text
exampleMatchingTx = T.IO.readFile "./mock/matchingTx.json"
exampleMatchingTx = T.IO.readFile "./mocks/matchingTx.json"

ouraFiltersSpec :: Spec
ouraFiltersSpec = Utils.killProcessesOnError do
it "Oura filters match tx it have to match, and don't match other" \spotGarbage -> do
focus $ it "Oura filters match tx it have to match, and don't match other" \spotGarbage -> do
Oura.withOura (Oura.MkWorkDir "./tmp") spotGarbage \oura -> do
tx <- exampleTx
matchingTx <- exampleMatchingTx
Expand All @@ -36,17 +37,7 @@ ouraFiltersSpec = Utils.killProcessesOnError do
<- pure $ extractInputTxHash matchingTx
outTxHash `shouldBe` inputTxHash
oura.shutDown
describe "Auction example" do
it "Recognizes 'Create' transition" \_ -> do
fail @IO @() "Not implemented"
it "Recognizes 'Start' transition" \_ -> do
fail @IO @() "Not implemented"
it "Recognizes 'MakeBid' transition" \_ -> do
fail @IO @() "Not implemented"
it "Recognizes 'Close' transition" \_ -> do
fail @IO @() "Not implemented"
it "Recognizes 'Buyout' transition" \_ -> do
fail @IO @() "Not implemented"
OuraFilters.Auction.spec

extractInputTxHash :: T.Text -> Either String T.Text
extractInputTxHash = Aeson.eitherDecodeStrictText >=> Aeson.parseEither \json -> do
Expand Down
21 changes: 21 additions & 0 deletions test/OuraFilters/Auction.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{-# LANGUAGE BlockArguments #-}
module OuraFilters.Auction (spec) where
import Prelude
import Utils (SpotGarbage)
import System.Process (ProcessHandle)
import Test.Hspec (describe, it, focus)
import Test.Hspec.Core.Spec (SpecM)

spec :: SpecM (SpotGarbage IO ProcessHandle) ()
spec =
describe "Auction example" do
focus $ it "Recognizes 'Create' transition" \spotGarbage -> do
fail @IO @() "Not implemented"
it "Recognizes 'Start' transition" \spotGarbage -> do
fail @IO @() "Not implemented"
it "Recognizes 'MakeBid' transition" \spotGarbage -> do
fail @IO @() "Not implemented"
it "Recognizes 'Close' transition" \spotGarbage -> do
fail @IO @() "Not implemented"
it "Recognizes 'Buyout' transition" \spotGarbage -> do
fail @IO @() "Not implemented"

0 comments on commit c7d664a

Please sign in to comment.