aboutsummaryrefslogtreecommitdiff
path: root/internal/cli/liturgy_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 12:58:31 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 12:58:31 +0200
commit6d78c65c58820f79ec5a978a9476d29969da218f (patch)
tree2045bf9f453c407bf8d60053876531420a1c251a /internal/cli/liturgy_test.go
parent27911b8f2574563ddd5d0de75f708503067069c9 (diff)
downloadlectio-6d78c65c58820f79ec5a978a9476d29969da218f.tar.gz
lectio-6d78c65c58820f79ec5a978a9476d29969da218f.zip
feat(cli): 'lectio --liturgy/-L' prints the computed liturgical day offline
Uses the pure engine + embedded universal calendar; UI-language names, rank, colour, cycles, and inline proper readings. Added the Assumption's propers.
Diffstat (limited to 'internal/cli/liturgy_test.go')
-rw-r--r--internal/cli/liturgy_test.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/internal/cli/liturgy_test.go b/internal/cli/liturgy_test.go
new file mode 100644
index 0000000..c3ab0b4
--- /dev/null
+++ b/internal/cli/liturgy_test.go
@@ -0,0 +1,33 @@
+package cli
+
+import (
+ "bytes"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/lukaszkasprzak/lectio/internal/config"
+)
+
+func TestRunLiturgy(t *testing.T) {
+ dir := t.TempDir()
+ t.Setenv("LECTIO_CONFIG", filepath.Join(dir, "config.ini"))
+ cfg, err := config.Load()
+ if err != nil {
+ t.Fatal(err)
+ }
+ var buf bytes.Buffer
+ if code := runLiturgy(cfg, "2025-08-15", &buf, &buf); code != 0 {
+ t.Fatalf("exit code %d", code)
+ }
+ out := buf.String()
+ if !strings.Contains(out, "2025-08-15") {
+ t.Errorf("missing date:\n%s", out)
+ }
+ if !strings.Contains(strings.ToLower(out), "solemnity") || !strings.Contains(out, "Assumption") {
+ t.Errorf("2025-08-15 should be the Assumption solemnity:\n%s", out)
+ }
+ if !strings.Contains(out, "gospel:") {
+ t.Errorf("proper reading not shown:\n%s", out)
+ }
+}