So I just ran into an infuriating error while running my tests and I'm
unsure if the error message can be improved to help someone in my position
for the next time.
Situation:
I have a model. I'm writing a test to ensure the model is valid. My model
has a validation like so:
def validate
super
validates_presence [:package_name]
validates_unique :package_name, :message => "That package name is already
in use."
end
When running the test, I was receiving the error:
NameError: undefined local variable or method `package_name' for
#<CustomerServiceType @values={}>
I couldn't figure out the root cause because I manually tested this in
`padrino c` and everything worked.
Turns out I hadn't run my table migrations in my test environment! I was
pulling my hair out.
Is there a way the error message could be modified to perhaps let people
know that the database table Sequel is trying to reference doesn't exist?
Just a thought.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.