Replies: 1 comment
-
The mock adapters are mostly useful for testing Sequel itself. It's not a good idea to use them for testing applications, and the documentation you linked to does not recommend using the mock adapters. Even when the mock adapters are used correctly, they give you no assurance that your application works the way it should. This is the reason Sequel has extensive integration/adapter tests in addition to its specs. My recommendation would be to test with a real database adapter and not a mock adapter. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Sequel to connect with a Datalake. To make sure the integrity I have added some tests using rspec. But the problem is that when I am running single file the test is passing successfully but when I am running the test of the whole repository the tests are failing. I investigated a bit and i found that the data isn't being cleared in every context. As a result the mock data of one test is creating impact to the other tests.
I have added the following steps to write the specs
Connection
before running test, i am configuring the columns by the following way
Mocking data
By the above way, the mock data isn't working perfectly. Because, I am expecting to have the mock data separated from one context to another context
I also tried to follow this doc https://github.com/jeremyevans/sequel/blob/master/doc/testing.rdoc but it seems that it's not working for me. I am assuming that it's not working because of directly adding the data in dataset rather than putting the data in DB.
Can someone help me to get rid of this situation? What is the best way to use mock data in sequel testing using rspec.
Beta Was this translation helpful? Give feedback.
All reactions