I have a module defined along the following lines:
module SomeModule
DB = Sequel.connect("sqlite://database.db")
end
I'm using aruba
(i.e. cucumber
) in my tests, as this module is a CLI application.
My problem is that when I add a record using the CLI, I am unable to see that record in my tests.
The apparent reason for this is that my tests and the CLI app are not using the same instance of Sequel, and therefore, updates done from CLI are not being seen by the tests, or so it seems.
When I redeclare the DB
's value, I can instantly see my new records. Can someone tell me what I am doing wrong? And, how someone will usually approach the Sequel tests?
UPDATE:
I can confirm that the objects are different. I get different SomeModule::DB.object_id
for both cases:
70261673298620
70361073575380