Veraticus/huey — pull request #13 by jcasimir (2013-11-21 18:24:21+00:00)
Title: Smoothing Registration

Thanks for putting this gem together. I'm using it with a class of 25 ruby devs next week and we'll surely find some useful ways to contribute.

I had trouble getting started in IRB. Specifically, when Huey's default UUID was not yet whitelisted, I couldn't find my bulbs. I would run `Huey::Bulb.all` and get the exception. I'd push the button on the bridge, then run the `.all` again. It was responding quickly, showing me that it had cached the return value, but that return was blank.

First, I revised the README to recommend hitting the bridge link button before your first usage, so the problem can just be avoided.

I then wrote a test imitating two calls to `.all` where *each* should raise the registration exception.

I then refactored `.all`. Previously, the line

```
@all = Huey::Group.new
```

Was setting `@all` even if the subsequent lines raised an exception. The following call to `.all` would then return this blank group.