add test for internal plugins with -plugin-dir

-plugin-dir was short-circuiting the discovery for internal plugins
This commit is contained in:
James Bardin 2018-01-05 11:51:09 -05:00
parent 5a9e0cf763
commit 5a975d9997
2 changed files with 25 additions and 0 deletions

View File

@ -1063,3 +1063,27 @@ func TestInit_pluginDirProvidersDoesNotGet(t *testing.T) {
t.Fatalf("bad: \n%s", ui.OutputWriter)
}
}
// Verify that plugin-dir doesn't prevent discovery of internal providers
func TestInit_pluginWithInternal(t *testing.T) {
td := tempDir(t)
copy.CopyDir(testFixturePath("init-internal"), td)
defer os.RemoveAll(td)
defer testChdir(t, td)()
ui := new(cli.MockUi)
m := Meta{
testingOverrides: metaOverridesForProvider(testProvider()),
Ui: ui,
}
c := &InitCommand{
Meta: m,
}
args := []string{"-plugin-dir", "./"}
//args := []string{}
if code := c.Run(args); code != 0 {
t.Fatalf("error: %s", ui.ErrorWriter)
}
}

View File

@ -0,0 +1 @@
provider "terraform" {}