Allow testing with fake data Sushi::test() #33
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EDIT:
This PR branch has been rebased on the master to make merging easier.
The original commit is here e6d61c1
Original message
This PR allows to use a set of fake data during tests.
It will change the sushi connection to
:memory
and migrate it with the test rows.Why use fake data
Caleb already approved the idea of fetching rows via the
getRows()
.I'm using sushi in app that i'm currently building, and i'm using the
getRows()
(i implemented that locally until this PR (#31) is merged) to read data from anini
file. Since the data is not static (defined in the model) i would like to decouple my test from any ini file and use some fake data in my tests.This can be merged now if caleb is open for adding test
test()
method.Also if caleb wants to hold off until this #31 is merged, then leave it open and i will update it once #31 is merged.