Skip to content

Commit

Permalink
provider/zencoder: fix test to look at the message instead of error obj
Browse files Browse the repository at this point in the history
The old approach will no longer work with Go 1.13+ (meaning it's broken
on master today). Doing a reflect.DeepEqual in an error object is not
the right thing to do with interfaces anyways.
  • Loading branch information
Francisco Souza committed Mar 4, 2019
1 parent f295f70 commit 4618300
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions provider/zencoder/zencoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package zencoder

import (
"encoding/json"
"errors"
"os"
"reflect"
"testing"
Expand Down Expand Up @@ -145,8 +144,8 @@ func TestCreatePresetError(t *testing.T) {
}

_, err = provider.CreatePreset(preset)
if !reflect.DeepEqual(err, errors.New("preset name missing")) {
t.Errorf("Got wrong error. Want %#v. Got %#v", errors.New("preset name missing"), err)
if expectedMsg := "preset name missing"; err.Error() != expectedMsg {
t.Errorf("got wrong error message\nwant %q\ngot %q", expectedMsg, err.Error())
}
}

Expand Down

0 comments on commit 4618300

Please sign in to comment.