On Friday, July 31, 2015 at 7:36:35 AM UTC-7, Dany Marcoux wrote:
>
> My problem is that I keep getting an error when running my tests. This is 
> the error I get:
>
> Sequel::Plugins::ValidationHelpers::#validates_greater_than::a column 
> which isn't of type Integer#test_0001_must not be valid:
> ArgumentError: wrong number of arguments (1 for 0)
>     /home/dany/.rvm/gems/ruby-2.2.1/gems/sequel-4.24.0/lib/sequel/model/
> base.rb:135:in `columns'
>     
> /home/dany/projets/bdv/spec/lib/sequel_plugins_validationhelpers_spec.rb:10:in
>  
> `block (3 levels) in <top (required)>'
>     
> /home/dany/projets/bdv/spec/lib/sequel_plugins_validationhelpers_spec.rb:5:in 
> `initialize'
>     /home/dany/projets/bdv/spec/lib/sequel_plugins_validationhelpers_spec.
> rb:5:in `new'
>     
> /home/dany/projets/bdv/spec/lib/sequel_plugins_validationhelpers_spec.rb:5:in 
> `block (2 levels) in <top (required)>'
>
>
>
> What would be the best way to test my new instance method? Am I doing too 
> much by trying to replicate the specs in the Sequel project?
>

Yes.  The exception here is because Model.columns doesn't take any 
arguments, except in the Sequel specs where it is overridden to set the 
columns to use (since the database is mocked).

Note that you probably don't want to add this to the ValidationHelpers 
plugin.  Either add it to your own module or plugin that you include in 
your model classes.

Thanks,
Jeremy

-- 
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 http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to