feat: add --prune and a rolled-back --dry-run to bm:seed
This commit is contained in:
@@ -55,12 +55,11 @@ func TestSeedCommandChecksTheFileBeforeTheDatabase(t *testing.T) {
|
||||
}
|
||||
|
||||
out.Reset()
|
||||
if err := bonfire.Call(context.Background(), cmds, "bm:seed", []string{"../testdata/seed.example.json", "--dry-run"}, &out); err != nil {
|
||||
t.Fatalf("dry run: %v", err)
|
||||
}
|
||||
if called || !strings.Contains(out.String(), "3 courses") {
|
||||
t.Errorf("dry run called=%v output %q", called, out.String())
|
||||
err = bonfire.Call(context.Background(), cmds, "bm:seed", []string{"../testdata/seed.example.json", "--dry-run", "--prune"}, &out)
|
||||
if !called || err == nil || !strings.Contains(out.String(), "3 courses") {
|
||||
t.Errorf("dry run called=%v err=%v output %q, want the validation line and the withDB error", called, err, out.String())
|
||||
}
|
||||
called = false
|
||||
|
||||
err = bonfire.Call(context.Background(), cmds, "bm:seed", []string{"../testdata/seed.example.json"}, &out)
|
||||
if !called || err == nil {
|
||||
|
||||
Reference in New Issue
Block a user