2019-09-15 21:22:38 +03:00
|
|
|
module Example exposing (..)
|
|
|
|
|
|
|
|
import Expect exposing (Expectation)
|
2019-09-15 21:46:00 +03:00
|
|
|
import Pages.Directory as Directory exposing (Directory)
|
|
|
|
import Pages.PagePath as PagePath exposing (PagePath)
|
2019-09-15 21:22:38 +03:00
|
|
|
import Test exposing (..)
|
|
|
|
|
|
|
|
|
|
|
|
suite : Test
|
|
|
|
suite =
|
2019-09-15 21:46:00 +03:00
|
|
|
describe "includes"
|
|
|
|
[ test "directory with single file" <|
|
|
|
|
\() ->
|
|
|
|
quickStart
|
|
|
|
|> Directory.includes (Directory.build () [ quickStart ] [ "docs" ])
|
|
|
|
|> Expect.equal True
|
|
|
|
, test "directory with two files" <|
|
|
|
|
\() ->
|
|
|
|
quickStart
|
|
|
|
|> Directory.includes (Directory.build () [ performance, quickStart ] [ "docs" ])
|
|
|
|
|> Expect.equal True
|
|
|
|
, test "file in different directory" <|
|
|
|
|
\() ->
|
|
|
|
notInDocsDir
|
|
|
|
|> Directory.includes (Directory.build () [ performance, quickStart, notInDocsDir ] [ "docs" ])
|
|
|
|
|> Expect.equal False
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
quickStart =
|
|
|
|
PagePath.build () [ "docs", "quick-start" ]
|
|
|
|
|
|
|
|
|
|
|
|
performance =
|
|
|
|
PagePath.build () [ "docs", "performance" ]
|
|
|
|
|
|
|
|
|
|
|
|
notInDocsDir =
|
|
|
|
PagePath.build () [ "notInDocsDir" ]
|