From 215a9bf0fe777a6a5517f9e3efa642db4dbf7e14 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 17 Nov 2023 15:04:36 +0100 Subject: [PATCH] Add regression test for malformed version in clj --- src/test/python/domain/test_build_file.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/python/domain/test_build_file.py b/src/test/python/domain/test_build_file.py index 7e199ba..58fbea7 100644 --- a/src/test/python/domain/test_build_file.py +++ b/src/test/python/domain/test_build_file.py @@ -182,3 +182,17 @@ def test_should_parse_and_set_version_for_clj(): '\n(defproject org.domaindrivenarchitecture/c4k-jira "2.0.0"\n:dependencies [[org.clojure/clojure "1.11.0"]]\n)\n ' == sut.content ) + +def test_should_throw_for_clj_wrong_version(): + sut = BuildFile( + Path("./project.clj"), + """ +(defproject org.domaindrivenarchitecture/c4k-jira "1.1.5-Snapshot" + :description "jira c4k-installation package" + :url "https://domaindrivenarchitecture.org" +) +""", + ) + + with pytest.raises(RuntimeError): + sut.get_version() \ No newline at end of file