command: fix tests

This commit is contained in:
Mitchell Hashimoto 2014-07-22 19:43:09 -07:00
parent 7221e01110
commit dc0ec11ec9
3 changed files with 9 additions and 6 deletions

View File

@ -487,7 +487,7 @@ func TestApply_vars(t *testing.T) {
actual = v.(string)
}
return nil, nil
return &terraform.ResourceDiff{}, nil
}
args := []string{
@ -530,7 +530,7 @@ func TestApply_varFile(t *testing.T) {
actual = v.(string)
}
return nil, nil
return &terraform.ResourceDiff{}, nil
}
args := []string{

View File

@ -85,6 +85,7 @@ func testStateFile(t *testing.T, s *terraform.State) string {
func testProvider() *terraform.MockResourceProvider {
p := new(terraform.MockResourceProvider)
p.DiffReturn = &terraform.ResourceDiff{}
p.RefreshFn = func(
s *terraform.ResourceState) (*terraform.ResourceState, error) {
return s, nil

View File

@ -490,8 +490,9 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc {
// If this happened, then the diff above returned a bad diff.
if diff == nil {
return fmt.Errorf(
"%s: diff became nil during Apply. This is a bug with " +
"the resource provider. Please report a bug.")
"%s: diff became nil during Apply. This is a bug with "+
"the resource provider. Please report a bug.",
r.Id)
}
// Delete id from the diff because it is dependent on
@ -506,8 +507,9 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc {
"\n\nDiff 2: %#v",
r.Diff, diff)
return fmt.Errorf(
"%s: diffs didn't match during apply. This is a " +
"bug with the resource provider, please report a bug.")
"%s: diffs didn't match during apply. This is a "+
"bug with the resource provider, please report a bug.",
r.Id)
}
}