Skip to content

Commit

Permalink
Merge pull request #10 from project-fuzzball/expect
Browse files Browse the repository at this point in the history
Assert -> Expect
  • Loading branch information
Richard Feldman committed Jun 25, 2016
2 parents 1fd2494 + f94422b commit e4fe666
Show file tree
Hide file tree
Showing 9 changed files with 481 additions and 410 deletions.
6 changes: 3 additions & 3 deletions elm-package.json
@@ -1,5 +1,5 @@
{
"version": "1.2.0",
"version": "2.0.0",
"summary": "Unit testing support with Console/Html/String outputs.",
"repository": "https://github.com/project-fuzzball/test.git",
"license": "BSD-3-Clause",
Expand All @@ -11,7 +11,7 @@
"Test.Runner",
"Test.Runner.String",
"Test.Runner.Log",
"Assert",
"Expect",
"Fuzz"
],
"dependencies": {
Expand All @@ -20,4 +20,4 @@
"mgold/elm-random-pcg": "2.1.0 <= v < 3.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
}
}
22 changes: 16 additions & 6 deletions examples/LogRunnerExample.elm
Expand Up @@ -8,7 +8,7 @@ $ node elm.js
Note that this always uses an initial seed of 42, since it can't do effects.
-}

import Assert
import Expect
import Test exposing (..)
import Test.Runner.Log
import Html.App
Expand Down Expand Up @@ -39,28 +39,38 @@ testOxfordify =
[ test "returns an empty string" <|
\() ->
oxfordify "This sentence is empty" "." []
|> Assert.equal ""
|> Expect.equal ""
]
, describe "given a sentence with one item"
[ test "still contains one item" <|
\() ->
oxfordify "This sentence contains " "." [ "one item" ]
|> Assert.equal "This sentence contains one item."
|> Expect.equal "This sentence contains one item."
]
, describe "given a sentence with multiple items"
[ test "returns an oxford-style sentence" <|
\() ->
oxfordify "This sentence contains " "." [ "one item", "two item" ]
|> Assert.equal "This sentence contains one item and two item."
|> Expect.equal "This sentence contains one item and two item."
, test "returns an oxford-style sentence" <|
\() ->
oxfordify "This sentence contains " "." [ "one item", "two item", "three item" ]
|> Assert.equal "This sentence contains one item, two item, and three item."
|> Expect.equal "This sentence contains one item, two item, and three item."
]
, describe "comparisons"
[ test "one is greater than two" <|
\() ->
1
|> Expect.greaterThan 2
, test "three is less than one" <|
\() ->
3
|> Expect.lessThan 1
]
, describe "a long failure message"
[ test "long failure!" <|
\() ->
Assert.equal "html, body {\nwidth: 100%;\nheight: 100%;\nbox-sizing: border-box;\npadding: 0;\nmargin: 0;\n}\n\nbody {\nmin-width: 1280px;\noverflow-x: auto;\n}\n\nbody > div {\nwidth: 100%;\nheight: 100%;\n}\n\n.dreamwriterHidden {\ndisplay: none !important;\n}\n\n#dreamwriterPage {\nwidth: 100%;\nheight: 100%;\nbox-sizing: border-box;\nmargin: 0;\npadding: 8px;\nbackground-color: rgb(100, 90, 128);\ncolor: rgb(40, 35, 76);\n}"
Expect.equal "html, body {\nwidth: 100%;\nheight: 100%;\nbox-sizing: border-box;\npadding: 0;\nmargin: 0;\n}\n\nbody {\nmin-width: 1280px;\noverflow-x: auto;\n}\n\nbody > div {\nwidth: 100%;\nheight: 100%;\n}\n\n.dreamwriterHidden {\ndisplay: none !important;\n}\n\n#dreamwriterPage {\nwidth: 100%;\nheight: 100%;\nbox-sizing: border-box;\nmargin: 0;\npadding: 8px;\nbackground-color: rgb(100, 90, 128);\ncolor: rgb(40, 35, 76);\n}"
"html, body {\nwidth: 100%;\nheight: 100%;\nbox-sizing: border-box;\npadding: 0;\nmargin: 0;\n}\n\nbody {\nmin-width: 1280px;\noverflow-x: auto;\n}\n\nbody > div {\nwidth: 100%;\nheight: 100%;\n}\n\n.dreamwriterHidden {\ndisplay: none !important;\n}\n\n#Page {\nwidth: 100%;\nheight: 100%;\nbox-sizing: border-box;\nmargin: 0;\npadding: 8px;\nbackground-color: rgb(100, 90, 128);\ncolor: rgb(40, 35, 76);\n}"
]
]

0 comments on commit e4fe666

Please sign in to comment.