(t *testing.T)
| 368 | } |
| 369 | |
| 370 | func TestOutput_withoutShowSensitiveArg(t *testing.T) { |
| 371 | originalState := stateWithSensitiveValueForOutput() |
| 372 | |
| 373 | statePath := testStateFile(t, originalState) |
| 374 | |
| 375 | view, done := testView(t) |
| 376 | c := &OutputCommand{ |
| 377 | Meta: Meta{ |
| 378 | WorkingDir: workdir.NewDir("."), |
| 379 | testingOverrides: metaOverridesForProvider(testProvider()), |
| 380 | View: view, |
| 381 | }, |
| 382 | } |
| 383 | |
| 384 | args := []string{ |
| 385 | "-state", statePath, |
| 386 | } |
| 387 | code := c.Run(args) |
| 388 | output := done(t) |
| 389 | if code != 0 { |
| 390 | t.Fatalf("bad: \n%s", output.Stderr()) |
| 391 | } |
| 392 | |
| 393 | actual := strings.TrimSpace(output.Stdout()) |
| 394 | if actual != "foo = <sensitive>" { |
| 395 | t.Fatalf("bad: %#v", actual) |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | // stateWithSensitiveValueForOutput return a state with an output value |
| 400 | // marked as sensitive. |
nothing calls this directly
no test coverage detected