lundi 23 janvier 2017

How to test instance level Sequel::Model validations using minitest

Does anybody know of a straight forward method to test sequel model validations defined on instance level within the minitest framework?

Background:

I am developing a web application using sinatra and Sequel with an squlite database. The whole thing is a continuous development flow, since the web-app is part of a much larger development project, which is still under a lot of change. For that reason I am relying heavily on testing, since I have to "poke" around deeper in the data-structures quite regularly. As the testing framework I am using minitest with spec-files.

Now I run into a small problem. I want to test my Sequel::Model validations with minitest. I am using the :validation_helper plugin for Sequel::Model which quite nicely generates validations on instance level. My problem now is, that the only methods to test validations I found (e.g. minitest-sequel) only work on class level validation, which I would like to avoid.

Aucun commentaire:

Enregistrer un commentaire