|
81 | 81 | "/home/user/repo" '("stale-branch")) |
82 | 82 | :to-be nil))) |
83 | 83 |
|
84 | | -(describe "magit-standup--collect-commits" |
85 | | - (it "sets default-directory to the repo path" |
86 | | - (let ((magit-standup-author "alice") |
87 | | - captured-dirs) |
88 | | - (spy-on 'magit-git-lines :and-call-fake |
89 | | - (lambda (&rest _) |
90 | | - (push default-directory captured-dirs) |
91 | | - nil)) |
92 | | - (magit-standup--collect-commits "/tmp/my-repo" "2026-01-05") |
93 | | - (expect captured-dirs :not :to-be nil) |
94 | | - (dolist (dir captured-dirs) |
95 | | - (expect dir :to-equal "/tmp/my-repo/")))) |
96 | | - |
| 84 | +(describe "magit-standup--resolve-author" |
97 | 85 | (it "uses magit-standup-author when set" |
98 | 86 | (let ((magit-standup-author "alice")) |
99 | 87 | (spy-on 'magit-git-string) |
100 | | - (spy-on 'magit-git-lines :and-return-value nil) |
101 | | - (magit-standup--collect-commits "/tmp/repo" "2026-01-05") |
| 88 | + (magit-standup--resolve-author "/tmp/repo") |
102 | 89 | (expect 'magit-git-string :not :to-have-been-called))) |
103 | 90 |
|
104 | 91 | (it "falls back to git config user.email" |
105 | 92 | (let ((magit-standup-author nil)) |
106 | 93 | (spy-on 'magit-git-string :and-return-value "bob@example.com") |
107 | | - (spy-on 'magit-git-lines :and-return-value nil) |
108 | | - (magit-standup--collect-commits "/tmp/repo" "2026-01-05") |
| 94 | + (expect (magit-standup--resolve-author "/tmp/repo") |
| 95 | + :to-equal "bob@example.com") |
109 | 96 | (expect 'magit-git-string |
110 | 97 | :to-have-been-called-with "config" "user.email"))) |
111 | 98 |
|
112 | 99 | (it "signals error when no author can be determined" |
113 | 100 | (let ((magit-standup-author nil)) |
114 | 101 | (spy-on 'magit-git-string :and-return-value nil) |
115 | | - (expect (magit-standup--collect-commits "/tmp/repo" "2026-01-05") |
| 102 | + (expect (magit-standup--resolve-author "/tmp/repo") |
116 | 103 | :to-throw 'user-error)))) |
117 | 104 |
|
| 105 | +(describe "magit-standup--collect-commits" |
| 106 | + (it "sets default-directory to the repo path" |
| 107 | + (let ((magit-standup-author "alice") |
| 108 | + captured-dirs) |
| 109 | + (spy-on 'magit-git-lines :and-call-fake |
| 110 | + (lambda (&rest _) |
| 111 | + (push default-directory captured-dirs) |
| 112 | + nil)) |
| 113 | + (magit-standup--collect-commits "/tmp/my-repo" "2026-01-05") |
| 114 | + (expect captured-dirs :not :to-be nil) |
| 115 | + (dolist (dir captured-dirs) |
| 116 | + (expect dir :to-equal "/tmp/my-repo/"))))) |
| 117 | + |
118 | 118 | (describe "magit-standup--resolve-repos" |
119 | 119 | :var (tmpdir) |
120 | 120 |
|
|
0 commit comments