Split the code into library and application
This commit is contained in:
parent
a7114618c1
commit
840290491f
@ -19,18 +19,11 @@ common dependencies
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
|
||||
build-depends:
|
||||
base ^>= 4.16.4.0,
|
||||
|
||||
executable slackbuilder
|
||||
import: dependencies
|
||||
main-is: Main.hs
|
||||
|
||||
other-modules:
|
||||
SlackBuilder.CommandLine
|
||||
SlackBuilder.Config
|
||||
SlackBuilder.Download
|
||||
SlackBuilder.Package
|
||||
SlackBuilder.Trans
|
||||
SlackBuilder.Updater
|
||||
cryptonite >= 0.30,
|
||||
filepath ^>= 1.4.2,
|
||||
modern-uri ^>= 0.3.6,
|
||||
text ^>= 2.0
|
||||
default-language: Haskell2010
|
||||
default-extensions:
|
||||
DataKinds
|
||||
DuplicateRecordFields
|
||||
@ -41,25 +34,38 @@ executable slackbuilder
|
||||
QuasiQuotes
|
||||
TemplateHaskell
|
||||
TypeApplications
|
||||
|
||||
library slackbuilder-internal
|
||||
import: dependencies
|
||||
exposed-modules:
|
||||
SlackBuilder.Config
|
||||
SlackBuilder.Package
|
||||
SlackBuilder.Trans
|
||||
hs-source-dirs: lib
|
||||
build-depends:
|
||||
exceptions >= 0.10,
|
||||
tomland ^>= 1.3.3,
|
||||
transformers ^>= 0.5.6
|
||||
|
||||
executable slackbuilder
|
||||
import: dependencies
|
||||
main-is: Main.hs
|
||||
|
||||
other-modules:
|
||||
SlackBuilder.CommandLine
|
||||
SlackBuilder.Download
|
||||
SlackBuilder.Updater
|
||||
build-depends:
|
||||
aeson ^>= 2.2.0,
|
||||
bytestring ^>= 0.11.0,
|
||||
conduit ^>= 1.3.5,
|
||||
cryptonite >= 0.30,
|
||||
exceptions >= 0.10,
|
||||
filepath ^>= 1.4.2,
|
||||
http-client ^>= 0.7,
|
||||
modern-uri ^>= 0.3.6,
|
||||
optparse-applicative ^>= 0.18.1,
|
||||
process ^>= 1.6.17,
|
||||
req ^>= 3.13,
|
||||
text ^>= 2.0,
|
||||
tomland ^>= 1.3.3,
|
||||
transformers ^>= 0.5.6,
|
||||
unordered-containers ^>= 0.2.19,
|
||||
vector ^>= 0.13.0
|
||||
hs-source-dirs: app
|
||||
default-language: Haskell2010
|
||||
|
||||
test-suite slackbuilder-test
|
||||
import: dependencies
|
||||
@ -68,8 +74,7 @@ test-suite slackbuilder-test
|
||||
|
||||
other-modules:
|
||||
SlackBuilder.PackageSpec
|
||||
hs-source-dirs:
|
||||
tests
|
||||
default-language: Haskell2010
|
||||
hs-source-dirs: tests
|
||||
build-depends:
|
||||
hspec >= 2.10.9 && < 2.12
|
||||
hspec >= 2.10.9 && < 2.12,
|
||||
slackbuilder-internal
|
||||
|
@ -2,7 +2,17 @@ module SlackBuilder.PackageSpec
|
||||
( spec
|
||||
) where
|
||||
|
||||
import Test.Hspec (Spec)
|
||||
import SlackBuilder.Package
|
||||
import Test.Hspec (Spec, describe, it, shouldBe)
|
||||
import Text.URI.QQ (uri)
|
||||
|
||||
spec :: Spec
|
||||
spec = pure ()
|
||||
spec = do
|
||||
describe "renderDownloadWithVersion" $
|
||||
it "renders text as URL" $
|
||||
let given = DownloadTemplate
|
||||
$ pure
|
||||
$ StaticPlaceholder "https://example.com"
|
||||
actual = renderDownloadWithVersion given "1.2"
|
||||
expected = Just [uri|https://example.com|]
|
||||
in actual `shouldBe` expected
|
||||
|
Loading…
Reference in New Issue
Block a user