(t *testing.T)
| 317 | } |
| 318 | |
| 319 | func TestPauseError(t *testing.T) { |
| 320 | const n = "test_device_name" |
| 321 | viper.Set("spotify.device_name", n) |
| 322 | |
| 323 | m := new(mocks.Client) |
| 324 | |
| 325 | ds := []spotify.PlayerDevice{ |
| 326 | { |
| 327 | ID: "TEST_ID", |
| 328 | Active: true, |
| 329 | Restricted: false, |
| 330 | Name: n, |
| 331 | Type: "", |
| 332 | Volume: 0, |
| 333 | }, |
| 334 | } |
| 335 | |
| 336 | m.On("PlayerDevices").Return(ds, nil) |
| 337 | const e = "pause error" |
| 338 | m.On("Pause").Return(errors.New(e)) |
| 339 | |
| 340 | err := Pause(m) |
| 341 | assert.EqualError(t, err, e) |
| 342 | } |