Skip to content

Commit

Permalink
Add Expecto Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Behrens committed Dec 12, 2016
1 parent f8f8fbf commit 13c24f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Unquote/Assertions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module Internal =
| Xunit of Type
| Nunit of Type
| Fuchu of Type
| Expecto of Type
| Fsi
| Generic

Expand Down Expand Up @@ -82,13 +83,19 @@ module Internal =
//issue in vs 2010: http://stackoverflow.com/questions/2024036/strange-fsi-exe-behavior
if assemblies |> Seq.exists (fun a -> a.GetName().Name = "Fuchu") then
yield Fuchu (Type.GetType("Fuchu.AssertException, Fuchu"))
elif assemblies |> Seq.exists (fun a -> a.GetName().Name = "Expecto") then
yield Fuchu (Type.GetType("Expecto.AssertException, Expecto"))
else
yield Fsi

let ty = Type.GetType("Fuchu.AssertException, Fuchu")
if ty <> null then
yield Fuchu ty

let ty = Type.GetType("Expecto.AssertException, Expecto")
if ty <> null then
yield Expecto ty

let ty = Type.GetType("Xunit.Assert, xunit") //xunit v1
if ty <> null then
yield Xunit ty
Expand All @@ -109,6 +116,8 @@ module Internal =
match framework with
| Fuchu ty ->
(fun (msg : string) -> raise (Activator.CreateInstance(ty, msg) :?> Exception)) |> outputReducedExprsMsg
| Expecto ty ->
(fun (msg : string) -> raise (Activator.CreateInstance(ty, msg) :?> Exception)) |> outputReducedExprsMsg
| Fsi ->
fsiTestFailed
| Xunit ty ->
Expand Down

0 comments on commit 13c24f1

Please sign in to comment.