… by default * When no arguments are passed in, the end result is the same as when a nil is passed in, so there's no need to create an empty Hash and then "set" the internal state with it. Better to just default to nil, and short-circuit the call. * Added specs so that if anything other than nil or an object that responds to #to_hash is passed in an exception is raised. Like DM1, by default I *only* want constructors handling Hash-like objects or nil; anything else passed in should be considered an exceptional case.
Do not throw exception when nil is passed to #attributes=
… a hash
…d to hash instead of checking if not nil
… is nil
* Split constant lookup into a private method
* The names of the arguments passed into #coerce_and_append_member isn't an important detail for #coerce to know about, so just pass in all the args as-is
* The existing specs only tested two out of 3 possible states the method could exist in. Add another spec to cover the actual "happy path" when #coerce_and_append_member is implemented for the Collection subclass.
* For some reason RSpec::Mocks::Mock defines #to_str in rspec 2, and with the spec we're trying to assert what will happen when a non-String-like object is passed to the string coercion method.
* It looks like rspec 1 does not check the "from" value, only the "to" value, so make this change to allow the specs to pass with rspec 2.