summaryrefslogtreecommitdiff
path: root/test/SlackBuilder/PackageSpec.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2025-08-11 13:53:48 +0300
committerEugen Wissner <belka@caraus.de>2025-08-11 13:53:48 +0300
commita2e8e1bcf2fbfcc8cc1b980cca2b93df86e1a7fe (patch)
tree20644ae36ab6b5496f46e777b89bfa84bb1fa2f0 /test/SlackBuilder/PackageSpec.hs
parent8b3f87ecf2d623a276948bd388bb5a7a28d5139d (diff)
downloadslackbuilder-a2e8e1bcf2fbfcc8cc1b980cca2b93df86e1a7fe.tar.gz
Rename tests directory into test
Diffstat (limited to 'test/SlackBuilder/PackageSpec.hs')
-rw-r--r--test/SlackBuilder/PackageSpec.hs26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/SlackBuilder/PackageSpec.hs b/test/SlackBuilder/PackageSpec.hs
new file mode 100644
index 0000000..79fce72
--- /dev/null
+++ b/test/SlackBuilder/PackageSpec.hs
@@ -0,0 +1,26 @@
+{- This Source Code Form is subject to the terms of the Mozilla Public License,
+ v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ obtain one at https://mozilla.org/MPL/2.0/. -}
+
+module SlackBuilder.PackageSpec
+ ( spec
+ ) where
+
+import SlackBuilder.Package
+import Test.Hspec (Spec, describe, it, shouldBe)
+import Text.URI.QQ (uri)
+
+spec :: Spec
+spec = do
+ describe "renderDownloadWithVersion" $ do
+ it "renders text as URL" $
+ let given = DownloadTemplate "https://example.com"
+ actual = renderDownloadWithVersion given "1.2"
+ expected = Just [uri|https://example.com|]
+ in actual `shouldBe` expected
+
+ it "renders the components in order" $
+ let given = DownloadTemplate "https://example.com/{version}/segment"
+ actual = renderDownloadWithVersion given "1.2"
+ expected = Just [uri|https://example.com/1.2/segment|]
+ in actual `shouldBe` expected