No commit activity in last 3 years
No release in over 3 years
Installs/Autostarts a Neo4j instance for your tests
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 2.0.1
~> 3.12
~> 3.2.0

Runtime

~> 4.1.1
~> 4.0.0
>= 0
 Project Readme

neo4j_test_server

Auto-starts a local Neo4j instance for running integration tests

How to install

Install this neo4j_test_server from rubygems either directly:

gem install neo4j_test_server

Or through bundler

# in Gemfile
gem "neo4j_test_server"

In spec_helper.rb

require 'neo4j_test_server/rspec'

What does it do?

This gem will automatically startup a Neo4j server running locally for testing purposes. The default server starts at http://localhost:7474.

This gem also provides rspec hooks for tests that require Neo4j without requiring the server to be started for all of your tests.

By default, the gem will download and run the "Community-2.2.0" version of Neo4j, see below for changing the edition used.

Writing tests that use Neo4jTestServer

In spec_helper.rb

require 'neo4j_test_server'
require 'neo4j_test_server/rspec'

Then in your specs, tag the specs that require a neo4j server with 'neo4j: true'

describe 'My Tests' do
    describe 'using neo4j', neo4j: true do

    end

    describe 'neo4j unnecessary' do

    end
end

Using a different version of Neo4j

Before your tests run, call

require 'neo4j_test_server'

Neo4jTestServer.edition = 'community-2.0.4' # Or whatever version you'd like to use