Convert assert.Check with
git grep -l -P '^\s+assert\.Check\(t, ' | \
xargs perl -pi -e 's/^(\s+assert)\.Check(\(t, (?!is).*(\.Execute\(|\.Set\(|\.Write\(|\.Close\(|\.Untar\(|\.WriteFile\(|Validate\().*\)$)/\1.NilError\2/'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
@ -109,6 +109,6 @@ func TestCreatePlugin(t *testing.T) {
|
||||
|
||||
cmd := newCreateCommand(cli)
|
||||
cmd.SetArgs([]string{"plugin-foo", tmpDir.Path()})
|
||||
assert.Check(t, cmd.Execute())
|
||||
assert.NilError(t, cmd.Execute())
|
||||
assert.Check(t, is.Equal("plugin-foo\n", cli.OutBuffer().String()))
|
||||
}
|
||||
|
||||
@ -53,6 +53,6 @@ func TestPluginDisable(t *testing.T) {
|
||||
})
|
||||
cmd := newDisableCommand(cli)
|
||||
cmd.SetArgs([]string{"plugin-foo"})
|
||||
assert.Check(t, cmd.Execute())
|
||||
assert.NilError(t, cmd.Execute())
|
||||
assert.Check(t, is.Equal("plugin-foo\n", cli.OutBuffer().String()))
|
||||
}
|
||||
|
||||
@ -65,6 +65,6 @@ func TestPluginEnable(t *testing.T) {
|
||||
|
||||
cmd := newEnableCommand(cli)
|
||||
cmd.SetArgs([]string{"plugin-foo"})
|
||||
assert.Check(t, cmd.Execute())
|
||||
assert.NilError(t, cmd.Execute())
|
||||
assert.Check(t, is.Equal("plugin-foo\n", cli.OutBuffer().String()))
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ func TestRemove(t *testing.T) {
|
||||
})
|
||||
cmd := newRemoveCommand(cli)
|
||||
cmd.SetArgs([]string{"plugin-foo"})
|
||||
assert.Check(t, cmd.Execute())
|
||||
assert.NilError(t, cmd.Execute())
|
||||
assert.Check(t, is.Equal("plugin-foo\n", cli.OutBuffer().String()))
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ func TestRemoveWithForceOption(t *testing.T) {
|
||||
cmd := newRemoveCommand(cli)
|
||||
cmd.SetArgs([]string{"plugin-foo"})
|
||||
cmd.Flags().Set("force", "true")
|
||||
assert.Check(t, cmd.Execute())
|
||||
assert.NilError(t, cmd.Execute())
|
||||
assert.Check(t, force)
|
||||
assert.Check(t, is.Equal("plugin-foo\n", cli.OutBuffer().String()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user