Reputation: 641
I'm building a Rails app using Neo4j and the Neo4j.rb gem.
I've started the process of setting up some tests and have not been able to figure out how to keep my test database separate from the one I use in development.
I'd like to keep my development and test data separate, so as to have better test integrity and speed.
Is something like this possible? If so, what sort of configuration/settings would I have to set up?
Thanks.
Upvotes: 5
Views: 275
Reputation: 5472
Since Neo4j.rb 3.0 RC1, released at the beginning of September, you're able to specify separate test and development ports. Multi-tenancy isn't supported by Neo4j, so you end up starting two databases. See https://github.com/neo4jrb/neo4j/wiki/How-To-Test for info on setting this up, it's very easy. There are rake tasks for configuration.
A good practice, BTW, is to also set your development port to something other than the default using the rake tasks. It helps protect you from accidentally running tests from another project or starting a different project's dev environment and writing a foreign database.
Upvotes: 5
Reputation: 8950
I am not familiar at all with the Ruby wrapper, but you could use an impermanent remote database like this one: https://github.com/jexp/neo4j-in-memory-server.
This is a database especially suited for tests (this is actually this one under the hood) and available to any platforms!
Upvotes: 0