ducky/devices
ducky/devices/memstore.go
Return ErrDeviceNotFound when updating devices. If we can't find the Device we're supposed to update, return an ErrDeviceNotFound error. Write a unit test that tests for this behaviour.
1.1 --- a/memstore.go Fri Nov 27 10:37:27 2015 -0800 1.2 +++ b/memstore.go Fri Nov 27 11:32:15 2015 -0800 1.3 @@ -40,7 +40,7 @@ 1.4 1.5 device, ok := m.devices[change.DeviceID.String()] 1.6 if !ok { 1.7 - return nil // TODO: return an error 1.8 + return ErrDeviceNotFound 1.9 } 1.10 1.11 device = ApplyChange(device, change)