summaryrefslogtreecommitdiff
path: root/internal/cli/cli_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/cli_test.go')
-rw-r--r--internal/cli/cli_test.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/internal/cli/cli_test.go b/internal/cli/cli_test.go
index b08ffba..0e90a04 100644
--- a/internal/cli/cli_test.go
+++ b/internal/cli/cli_test.go
@@ -200,23 +200,15 @@ func TestCleanPreferredOverUpdate(t *testing.T) {
// banner for the default (non-raw) render, and is entirely absent from
// --raw output, which stays text-only for piping.
func TestDayInfoHeaderShown(t *testing.T) {
- html, err := os.ReadFile("../liturgy/testdata/2026-07-22.html")
- if err != nil {
- t.Fatal(err)
- }
- srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write(html)
- }))
- defer srv.Close()
- liturgy.SetBaseURL(srv.URL + "/liturgia/%s/Ewangelia")
- t.Setenv("XDG_CACHE_HOME", t.TempDir())
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
+ const name = "Saint Mary Magdalene" // universal sanctoral, authored in English
+
var out, errb bytes.Buffer
if code := Run([]string{"2026-07-22"}, nil, &out, &errb); code != 0 {
t.Fatalf("Run code=%d stderr=%q", code, errb.String())
}
- if !strings.Contains(out.String(), "Święto św. Marii Magdaleny") {
+ if !strings.Contains(out.String(), name) {
t.Errorf("stdout missing day-info header: %q", out.String())
}
@@ -225,7 +217,7 @@ func TestDayInfoHeaderShown(t *testing.T) {
if code := Run([]string{"2026-07-22", "-r"}, nil, &out, &errb); code != 0 {
t.Fatalf("Run --raw code=%d stderr=%q", code, errb.String())
}
- if strings.Contains(out.String(), "Święto św. Marii Magdaleny") {
+ if strings.Contains(out.String(), name) {
t.Errorf("--raw stdout should omit the day-info header: %q", out.String())
}
}