but this doesn’t let me see to what the id field was set.
I think you’re seeing a legitimate failure … You’re tripping up
against a
scoping problem in the line where you set the id. You’re setting a local
variable “id” to the value, which falls out of scope by the time your
spec
is verifying anything.
You’ll need something more like:
self.id = get_uuid
(and possibly an attr_accessor definition for :id as well …)
In spite of the fact that you have an #id= method, id = get_uuid is
setting a local variable, not invoking the #id= method. Use self.id = get_uuid to invoke the method and set the attribute.
Myron
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.