I'd like to unit test my models without requiring a database connection,
I'm currently using a mock database but I'm not sure if this is the right
approach since the model have no attribute accessors.
db = Sequel.mock
class MyModel < Sequel::Model
def started?
Time.now >= @start_time
end
end
foo = MyModel.new do |m|
m.start_time = Time.now
# undefined method `start_time=' for #<MyModel @values={}> (NoMethodError)
end
foo.started?
I'm probably missing something obvious, any help is appreciated. Thanks!
--
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.