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) actual = v.(string)
} }
return nil, nil return &terraform.ResourceDiff{}, nil
} }
args := []string{ args := []string{
@ -530,7 +530,7 @@ func TestApply_varFile(t *testing.T) {
actual = v.(string) actual = v.(string)
} }
return nil, nil return &terraform.ResourceDiff{}, nil
} }
args := []string{ args := []string{

View File

@ -85,6 +85,7 @@ func testStateFile(t *testing.T, s *terraform.State) string {
func testProvider() *terraform.MockResourceProvider { func testProvider() *terraform.MockResourceProvider {
p := new(terraform.MockResourceProvider) p := new(terraform.MockResourceProvider)
p.DiffReturn = &terraform.ResourceDiff{}
p.RefreshFn = func( p.RefreshFn = func(
s *terraform.ResourceState) (*terraform.ResourceState, error) { s *terraform.ResourceState) (*terraform.ResourceState, error) {
return s, nil 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 this happened, then the diff above returned a bad diff.
if diff == nil { if diff == nil {
return fmt.Errorf( return fmt.Errorf(
"%s: diff became nil during Apply. This is a bug with " + "%s: diff became nil during Apply. This is a bug with "+
"the resource provider. Please report a bug.") "the resource provider. Please report a bug.",
r.Id)
} }
// Delete id from the diff because it is dependent on // Delete id from the diff because it is dependent on
@ -506,8 +507,9 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc {
"\n\nDiff 2: %#v", "\n\nDiff 2: %#v",
r.Diff, diff) r.Diff, diff)
return fmt.Errorf( return fmt.Errorf(
"%s: diffs didn't match during apply. This is a " + "%s: diffs didn't match during apply. This is a "+
"bug with the resource provider, please report a bug.") "bug with the resource provider, please report a bug.",
r.Id)
} }
} }