(d4ce964) Record status, owner and tag changes in a history log, and bump to 0.29.0
The comments directory was already an append-only log with one event kind. It is now .worklane/history/<uuid>/, with the kind in the entry and in the filename after the stamp, so a ticket says how it got where it is and not only what was said about it. mv, chown and set --tags each write an entry after their own save and behind their own no-change return, so a refused or no-op edit records nothing. --actor is on all four writers now. An old comments directory is adopted on first access and a file with no marker reads as the comment it is, so nothing is migrated or rewritten. The log moves to src/history.rs, out of util.rs and handlers.rs, and the card's counter counts comments only: a ticket that has moved three times has not been talked about. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a1bdb5df49
commit
f454d212a4
+1
-1
@@ -314,7 +314,7 @@ fn check_leaves_nothing_behind() {
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| e.file_name().into_string().unwrap())
|
||||
.filter(|name| {
|
||||
!["backlog", "committed", "reviewing", "done", "comments"].contains(&name.as_str())
|
||||
!["backlog", "committed", "reviewing", "done", "history"].contains(&name.as_str())
|
||||
})
|
||||
.collect();
|
||||
assert_eq!(strays, Vec::<String>::new());
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ fn stray_files(worklane: &Path) -> Vec<String> {
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| e.file_name().into_string().unwrap())
|
||||
.filter(|name| {
|
||||
!["backlog", "committed", "reviewing", "done", "comments"].contains(&name.as_str())
|
||||
!["backlog", "committed", "reviewing", "done", "history"].contains(&name.as_str())
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
+20
-20
@@ -43,7 +43,7 @@ fn create_ticket(worklane_dir: &Path, status: &str, title: &str) -> String {
|
||||
|
||||
/// The one comment on a ticket, which every author test writes exactly one of.
|
||||
fn only_comment(worklane_dir: &Path, uuid: &str) -> String {
|
||||
let files: Vec<_> = fs::read_dir(worklane_dir.join("comments").join(uuid))
|
||||
let files: Vec<_> = fs::read_dir(worklane_dir.join("history").join(uuid))
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.collect();
|
||||
@@ -73,9 +73,9 @@ fn comment_creates_file_with_valid_ticket_uuid() {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
let comments_dir = worklane.join("comments").join(&uuid);
|
||||
assert!(comments_dir.exists());
|
||||
let files: Vec<_> = fs::read_dir(&comments_dir)
|
||||
let history_dir = worklane.join("history").join(&uuid);
|
||||
assert!(history_dir.exists());
|
||||
let files: Vec<_> = fs::read_dir(&history_dir)
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.collect();
|
||||
@@ -125,8 +125,8 @@ fn comment_includes_git_user_and_body() {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
let comments_dir = worklane.join("comments").join(&uuid);
|
||||
let files: Vec<_> = fs::read_dir(&comments_dir)
|
||||
let history_dir = worklane.join("history").join(&uuid);
|
||||
let files: Vec<_> = fs::read_dir(&history_dir)
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.collect();
|
||||
@@ -149,8 +149,8 @@ fn comment_stored_in_timestamped_file() {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
let comments_dir = worklane.join("comments").join(&uuid);
|
||||
let files: Vec<_> = fs::read_dir(&comments_dir)
|
||||
let history_dir = worklane.join("history").join(&uuid);
|
||||
let files: Vec<_> = fs::read_dir(&history_dir)
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.collect();
|
||||
@@ -160,14 +160,14 @@ fn comment_stored_in_timestamped_file() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn comment_creates_comments_directory() {
|
||||
fn comment_creates_the_history_directory() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
|
||||
let uuid = create_ticket(&worklane, "reviewing", "Dir Test");
|
||||
|
||||
let comments_dir = worklane.join("comments").join(&uuid);
|
||||
assert!(!comments_dir.exists());
|
||||
let history_dir = worklane.join("history").join(&uuid);
|
||||
assert!(!history_dir.exists());
|
||||
|
||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||
cmd.current_dir(temp.path())
|
||||
@@ -176,7 +176,7 @@ fn comment_creates_comments_directory() {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
assert!(comments_dir.exists());
|
||||
assert!(history_dir.exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -218,7 +218,7 @@ fn the_owner_flag_is_gone() {
|
||||
}
|
||||
|
||||
assert!(
|
||||
!worklane.join("comments").join(&uuid).exists(),
|
||||
!worklane.join("history").join(&uuid).exists(),
|
||||
"a comment was written despite the usage error"
|
||||
);
|
||||
}
|
||||
@@ -320,8 +320,8 @@ fn comment_falls_back_to_git_user_when_actor_omitted() {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
let comments_dir = worklane.join("comments").join(&uuid);
|
||||
let files: Vec<_> = fs::read_dir(&comments_dir)
|
||||
let history_dir = worklane.join("history").join(&uuid);
|
||||
let files: Vec<_> = fs::read_dir(&history_dir)
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.collect();
|
||||
@@ -348,8 +348,8 @@ fn comments_added_back_to_back_are_both_kept() {
|
||||
.success();
|
||||
}
|
||||
|
||||
let comments_dir = worklane.join("comments").join(&uuid);
|
||||
let files: Vec<_> = fs::read_dir(&comments_dir)
|
||||
let history_dir = worklane.join("history").join(&uuid);
|
||||
let files: Vec<_> = fs::read_dir(&history_dir)
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.collect();
|
||||
@@ -383,7 +383,7 @@ fn comment_accepts_a_body_that_begins_with_a_hyphen() {
|
||||
.success();
|
||||
}
|
||||
|
||||
let bodies: String = fs::read_dir(worklane.join("comments").join(&uuid))
|
||||
let bodies: String = fs::read_dir(worklane.join("history").join(&uuid))
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| fs::read_to_string(e.path()).unwrap())
|
||||
@@ -438,7 +438,7 @@ fn a_bare_double_hyphen_body_needs_a_separator() {
|
||||
let stderr = String::from_utf8(assert.get_output().stderr.clone()).unwrap();
|
||||
assert!(stderr.contains("<BODY>"), "unclear error: {stderr}");
|
||||
assert!(
|
||||
!worklane.join("comments").join(&uuid).exists(),
|
||||
!worklane.join("history").join(&uuid).exists(),
|
||||
"a comment was written despite the error"
|
||||
);
|
||||
|
||||
@@ -448,7 +448,7 @@ fn a_bare_double_hyphen_body_needs_a_separator() {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
let stored: String = fs::read_dir(worklane.join("comments").join(&uuid))
|
||||
let stored: String = fs::read_dir(worklane.join("history").join(&uuid))
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| fs::read_to_string(e.path()).unwrap())
|
||||
|
||||
+1
-1
@@ -474,7 +474,7 @@ fn stray_files(worklane: &std::path::Path) -> Vec<String> {
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| e.file_name().into_string().unwrap())
|
||||
.filter(|name| {
|
||||
!["backlog", "committed", "reviewing", "done", "comments"].contains(&name.as_str())
|
||||
!["backlog", "committed", "reviewing", "done", "history"].contains(&name.as_str())
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ fn stray_files(worklane: &Path) -> Vec<String> {
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| e.file_name().into_string().unwrap())
|
||||
.filter(|name| {
|
||||
!["backlog", "committed", "reviewing", "done", "comments"].contains(&name.as_str())
|
||||
!["backlog", "committed", "reviewing", "done", "history"].contains(&name.as_str())
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,351 @@
|
||||
//! The history log: what the CLI records about a ticket besides what somebody said.
|
||||
//!
|
||||
//! One file rather than a few tests in each command's suite: the rules are about the log
|
||||
//! and not about `mv` or `chown`, and the interesting cases are the ones where two
|
||||
//! commands have to agree — every mechanical entry has the same shape, and every refusal
|
||||
//! writes nothing.
|
||||
|
||||
use assert_cmd::Command;
|
||||
use assert_fs::TempDir;
|
||||
use assert_fs::fixture::{PathChild, PathCreateDir};
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Output;
|
||||
|
||||
const BIN_NAME: &str = env!("CARGO_BIN_EXE_worklane");
|
||||
const UUID: &str = "475534a3-8a0d-45cb-9a97-39c251dd8e39";
|
||||
|
||||
fn setup_worklane(temp: &TempDir) -> PathBuf {
|
||||
let worklane = temp.child(".worklane");
|
||||
worklane.create_dir_all().unwrap();
|
||||
|
||||
for dir in ["backlog", "committed", "reviewing", "done"] {
|
||||
worklane.child(dir).create_dir_all().unwrap();
|
||||
}
|
||||
|
||||
worklane.path().to_path_buf()
|
||||
}
|
||||
|
||||
/// A ticket with every field an entry can record a change to.
|
||||
fn create_ticket(worklane: &Path, status: &str) -> String {
|
||||
let filename = format!("{}_a-ticket.md", UUID);
|
||||
fs::write(
|
||||
worklane.join(status).join(&filename),
|
||||
format!(
|
||||
"# A ticket\n\
|
||||
\n\
|
||||
## Description\n\
|
||||
Something to do.\n\
|
||||
\n\
|
||||
## Acceptance Criteria\n\
|
||||
- [ ] Crit one\n\
|
||||
- [ ] Crit two\n\
|
||||
\n\
|
||||
## Implementation Plan\n\
|
||||
1. Step one\n\
|
||||
\n\
|
||||
## Metadata\n\
|
||||
\n\
|
||||
- **ID**: {}\n\
|
||||
- **Priority**: 3\n\
|
||||
- **Tags**: alpha\n\
|
||||
- **Due**: 2026-09-01\n\
|
||||
- **Owner**: alice\n\
|
||||
- **Status**: {}\n",
|
||||
UUID, status
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
filename
|
||||
}
|
||||
|
||||
/// Run with the actor named, so every author assertion is about the log and not about
|
||||
/// the git user of whoever runs the suite.
|
||||
fn run(temp: &TempDir, args: &[&str]) -> Output {
|
||||
Command::cargo_bin(BIN_NAME)
|
||||
.unwrap()
|
||||
.current_dir(temp.path())
|
||||
.env("WORKLANE_ACTOR", "claude")
|
||||
.args(args)
|
||||
.assert()
|
||||
.get_output()
|
||||
.clone()
|
||||
}
|
||||
|
||||
/// Every entry on the ticket, name and content, in the order the log sorts them.
|
||||
fn entries(worklane: &Path) -> Vec<(String, String)> {
|
||||
let dir = worklane.join("history").join(UUID);
|
||||
if !dir.exists() {
|
||||
return vec![];
|
||||
}
|
||||
|
||||
let mut found: Vec<(String, String)> = fs::read_dir(&dir)
|
||||
.unwrap()
|
||||
.filter_map(|entry| entry.ok())
|
||||
.map(|entry| {
|
||||
(
|
||||
entry.file_name().into_string().unwrap(),
|
||||
fs::read_to_string(entry.path()).unwrap(),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
found.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
found
|
||||
}
|
||||
|
||||
/// The one entry a call wrote, with its kind checked off the filename.
|
||||
fn only_entry(worklane: &Path, kind: &str) -> String {
|
||||
let found = entries(worklane);
|
||||
assert_eq!(found.len(), 1, "expected one entry, got {found:?}");
|
||||
assert!(found[0].0.ends_with(&format!("_{kind}.md")), "was {}", found[0].0);
|
||||
found[0].1.clone()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mv_writes_a_status_entry() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
run(&temp, &["mv", UUID, "--status", "committed"]);
|
||||
|
||||
let entry = only_entry(&worklane, "status");
|
||||
assert!(entry.starts_with("**Status**\nbacklog → committed\n"), "{entry:?}");
|
||||
assert!(entry.contains("**Author**: claude"), "{entry:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn chown_writes_an_owner_entry() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
run(&temp, &["chown", "bob", UUID]);
|
||||
|
||||
let entry = only_entry(&worklane, "owner");
|
||||
assert!(entry.starts_with("**Owner**\nalice → bob\n"), "{entry:?}");
|
||||
}
|
||||
|
||||
/// Clearing is the same field going somewhere, so it is logged, and the value it goes to
|
||||
/// is the sentinel the ticket now holds rather than a word this log invented.
|
||||
#[test]
|
||||
fn clearing_the_owner_writes_an_owner_entry() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
run(&temp, &["chown", "--clear", UUID]);
|
||||
|
||||
let entry = only_entry(&worklane, "owner");
|
||||
assert!(entry.starts_with("**Owner**\nalice → _Not set_\n"), "{entry:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn set_tags_writes_a_tags_entry() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
run(&temp, &["set", UUID, "--tags", "beta", "--tags", "gamma"]);
|
||||
|
||||
let entry = only_entry(&worklane, "tags");
|
||||
assert!(entry.starts_with("**Tags**\nalpha → beta, gamma\n"), "{entry:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn clearing_the_tags_writes_a_tags_entry() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
run(&temp, &["set", UUID, "--clear", "tags"]);
|
||||
|
||||
let entry = only_entry(&worklane, "tags");
|
||||
assert!(entry.starts_with("**Tags**\nalpha → _None_\n"), "{entry:?}");
|
||||
}
|
||||
|
||||
/// The fields that change often enough that a log of them is noise. `set` writing one of
|
||||
/// them is not an entry, and neither is a criterion being ticked.
|
||||
#[test]
|
||||
fn the_edits_that_are_not_logged_write_nothing() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
for args in [
|
||||
vec!["set", UUID, "--title", "A better title"],
|
||||
vec!["set", UUID, "--due", "2026-10-01"],
|
||||
vec!["set", UUID, "--priority", "1"],
|
||||
vec!["set", UUID, "--description", "Rewritten."],
|
||||
vec!["set", UUID, "--plan", "One step"],
|
||||
vec!["check", UUID, "1"],
|
||||
vec!["uncheck", UUID, "1"],
|
||||
vec!["append", UUID, "--description", "One more paragraph."],
|
||||
vec!["comment", UUID, "-", "--"],
|
||||
] {
|
||||
let out = run(&temp, &args);
|
||||
assert!(
|
||||
out.status.success(),
|
||||
"{args:?}: {:?}",
|
||||
String::from_utf8_lossy(&out.stderr)
|
||||
);
|
||||
}
|
||||
|
||||
// The comment is the exception: it is an entry, and the only one this run wrote.
|
||||
let found = entries(&worklane);
|
||||
assert_eq!(found.len(), 1, "{found:?}");
|
||||
assert!(found[0].0.ends_with("_comment.md"), "was {}", found[0].0);
|
||||
}
|
||||
|
||||
/// An edit reported as no change writes no entry: the field is already what the call
|
||||
/// asked for, and a log of that would be a log of nothing happening.
|
||||
#[test]
|
||||
fn a_no_op_edit_writes_nothing() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
for args in [
|
||||
vec!["mv", UUID, "--status", "backlog"],
|
||||
vec!["chown", "alice", UUID],
|
||||
vec!["set", UUID, "--tags", "alpha"],
|
||||
] {
|
||||
let out = run(&temp, &args);
|
||||
assert!(
|
||||
out.status.success(),
|
||||
"{args:?}: {:?}",
|
||||
String::from_utf8_lossy(&out.stderr)
|
||||
);
|
||||
assert_eq!(entries(&worklane), vec![], "{args:?} logged a change it did not make");
|
||||
}
|
||||
}
|
||||
|
||||
/// A refused move is not a move. The entry is written after the edit for exactly this.
|
||||
#[test]
|
||||
fn a_refused_move_writes_nothing() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "reviewing");
|
||||
|
||||
let backward = run(&temp, &["mv", UUID, "--status", "backlog"]);
|
||||
assert_eq!(backward.status.code(), Some(1));
|
||||
|
||||
let skipped = run(&temp, &["mv", UUID, "--status", "backlog", "-f"]);
|
||||
assert!(skipped.status.success(), "{:?}", String::from_utf8_lossy(&skipped.stderr));
|
||||
|
||||
// The forced one moved, so it is logged; the refused one is not.
|
||||
let found = entries(&worklane);
|
||||
assert_eq!(found.len(), 1, "{found:?}");
|
||||
assert!(found[0].1.contains("reviewing → backlog"), "{:?}", found[0].1);
|
||||
}
|
||||
|
||||
/// A failed edit logs nothing, whatever the failure. This ticket has no Owner field, so
|
||||
/// `chown` refuses it after resolving it and before writing anything.
|
||||
#[test]
|
||||
fn a_failed_edit_writes_nothing() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
fs::write(
|
||||
worklane.join("backlog").join(format!("{}_bare.md", UUID)),
|
||||
format!("# Bare\n\n## Metadata\n\n- **ID**: {}\n- **Status**: backlog\n", UUID),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let out = run(&temp, &["chown", "bob", UUID]);
|
||||
assert_eq!(out.status.code(), Some(1));
|
||||
assert_eq!(entries(&worklane), vec![], "a refused chown was logged");
|
||||
}
|
||||
|
||||
/// One sequence, oldest first, with a comment rendered as it always was and a field
|
||||
/// change as one line.
|
||||
#[test]
|
||||
fn show_prints_the_comments_and_the_changes_in_one_sequence() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
run(&temp, &["comment", UUID, "Picked this up."]);
|
||||
run(&temp, &["mv", UUID, "--status", "committed"]);
|
||||
run(&temp, &["chown", "bob", UUID]);
|
||||
|
||||
let out = run(&temp, &["show", UUID]);
|
||||
let stdout = String::from_utf8(out.stdout).unwrap();
|
||||
|
||||
assert!(stdout.contains("HISTORY"), "{stdout}");
|
||||
let said = stdout.find("Picked this up.").expect("the comment is missing");
|
||||
let moved = stdout.find("backlog → committed").expect("the move is missing");
|
||||
let owned = stdout.find("alice → bob").expect("the chown is missing");
|
||||
assert!(said < moved && moved < owned, "out of order:\n{stdout}");
|
||||
|
||||
for line in ["status backlog → committed", "owner alice → bob"] {
|
||||
assert!(stdout.contains(line), "{line:?} not in:\n{stdout}");
|
||||
}
|
||||
assert!(stdout.contains("From claude ("), "{stdout}");
|
||||
}
|
||||
|
||||
/// A ticket nothing has happened to says so, where it used to say there were no comments.
|
||||
#[test]
|
||||
fn show_says_so_when_there_is_no_history() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
let out = run(&temp, &["show", UUID]);
|
||||
assert!(
|
||||
String::from_utf8(out.stdout)
|
||||
.unwrap()
|
||||
.contains("No history yet.")
|
||||
);
|
||||
}
|
||||
|
||||
/// A board written by an older version: the directory is adopted on the first access,
|
||||
/// the entries in it are read as the comments they are, and nothing is rewritten.
|
||||
#[test]
|
||||
fn an_old_comments_directory_is_adopted() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
let legacy = worklane.join("comments").join(UUID);
|
||||
fs::create_dir_all(&legacy).unwrap();
|
||||
let name = "20260820_143012_123456.md";
|
||||
let content =
|
||||
"**Comment**\nSaid long ago.\n\n**Author**: Ansho Rei\n**Time**: 2026-08-20 14:30:12\n";
|
||||
fs::write(legacy.join(name), content).unwrap();
|
||||
|
||||
let out = run(&temp, &["show", UUID]);
|
||||
let stdout = String::from_utf8(out.stdout).unwrap();
|
||||
assert!(stdout.contains("Said long ago."), "{stdout}");
|
||||
assert!(stdout.contains("From Ansho Rei ("), "{stdout}");
|
||||
|
||||
assert!(!worklane.join("comments").exists(), "the old directory survived");
|
||||
let moved = worklane.join("history").join(UUID).join(name);
|
||||
assert_eq!(fs::read_to_string(&moved).unwrap(), content, "the entry was rewritten");
|
||||
|
||||
// And a new entry lands beside it, in the order it was written.
|
||||
run(&temp, &["mv", UUID, "--status", "committed"]);
|
||||
let found = entries(&worklane);
|
||||
assert_eq!(found.len(), 2, "{found:?}");
|
||||
assert_eq!(found[0].0, name);
|
||||
assert!(found[1].0.ends_with("_status.md"), "was {}", found[1].0);
|
||||
}
|
||||
|
||||
/// The flag is spelled the same on every command that writes an entry, and it overrides
|
||||
/// the variable on each of them.
|
||||
#[test]
|
||||
fn the_actor_flag_names_the_writer_on_every_command_that_writes_one() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_ticket(&worklane, "backlog");
|
||||
|
||||
run(&temp, &["comment", UUID, "By hand.", "--actor", "opencode"]);
|
||||
run(&temp, &["mv", UUID, "--status", "committed", "--actor", "opencode"]);
|
||||
run(&temp, &["chown", "bob", UUID, "--actor", "opencode"]);
|
||||
run(&temp, &["set", UUID, "--tags", "beta", "--actor", "opencode"]);
|
||||
|
||||
let found = entries(&worklane);
|
||||
assert_eq!(found.len(), 4, "{found:?}");
|
||||
for (name, content) in found {
|
||||
assert!(content.contains("**Author**: opencode"), "{name}: {content:?}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user