summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-04-16 18:50:44 +0100
committerLars Wirzenius <liw@liw.fi>2014-04-16 18:50:44 +0100
commit5b3ccf57b5d25547208fcdaae2ab3ec6be86a74b (patch)
tree408ee06e649bc96c33c0eee90c519f9a10a00e59
parentfefed29ece0719acefb4bc01753ec1f4349f96a9 (diff)
downloadcopyright-statement-lint-5b3ccf57b5d25547208fcdaae2ab3ec6be86a74b.tar.gz
Add test for range of copyright years
-rw-r--r--yarns/010-tests.yarn33
1 files changed, 33 insertions, 0 deletions
diff --git a/yarns/010-tests.yarn b/yarns/010-tests.yarn
index ec71561..6456ca1 100644
--- a/yarns/010-tests.yarn
+++ b/yarns/010-tests.yarn
@@ -79,6 +79,39 @@ Itemised copyright years
THEN exit code is 1
AND stderr contains "FOOBAR.*2015 not contained"
+Range of copyright years
+------------------------
+
+ SCENARIO range of copyright years
+ GIVEN a file FOOBAR containing "Copyright 1999-2014 Foo Bar"
+
+ GIVEN commit year is 1998
+ WHEN copyright-statement-lint is run against FOOBAR
+ THEN exit code is 1
+ AND stderr contains "FOOBAR.*1998 not contained"
+
+ GIVEN commit year is 1999
+ WHEN copyright-statement-lint is run against FOOBAR
+ THEN exit code is 0
+
+ GIVEN commit year is 2000
+ WHEN copyright-statement-lint is run against FOOBAR
+ THEN exit code is 0
+
+ GIVEN commit year is 2013
+ WHEN copyright-statement-lint is run against FOOBAR
+ THEN exit code is 0
+
+ GIVEN commit year is 2014
+ WHEN copyright-statement-lint is run against FOOBAR
+ THEN exit code is 0
+
+ GIVEN commit year is 2015
+ WHEN copyright-statement-lint is run against FOOBAR
+ THEN exit code is 1
+ AND stderr contains "FOOBAR.*2015 not contained"
+
+
Implementations
===============