Skip to content

Commit 2e45ec0

Browse files
Merge pull request #2 from paegun/switch-to-rspec-README
Switch to rpec w/i README
2 parents d2281cd + 25b0d1f commit 2e45ec0

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage/*

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ RedisGraph connects to an active Redis server, defaulting to `host: localhost, p
5656
These parameters are described fully in the documentation for https://github.com/redis/redis-rb
5757

5858
## Running tests
59-
A simple test suite is provided, and can be run with:
60-
`ruby test/test_suite.rb`
59+
To ensure prerequisites are installed, run the following:
60+
`bundle install`
61+
6162
These tests expect a Redis server with the Graph module loaded to be available at localhost:6379
6263

64+
The currently compatible version of the RedisGraph module may be run as follows:
65+
`docker run -p 6379:6379 -it --rm redislabs/redisgraph:1.2.2`
66+
67+
A simple test suite is provided, and can be run with:
68+
`rspec`

lib/redisgraph/connection.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def verify_module()
1010
redis_version = @connection.info["redis_version"]
1111
major_version = redis_version.split('.').first.to_i
1212
raise ServerError, "Redis 4.0 or greater required for RedisGraph support." unless major_version >= 4
13-
resp = @connection.call("MODULE", "LIST")
14-
raise ServerError, "RedisGraph module not loaded." unless resp.first && resp.first.include?("graph")
13+
modules = @connection.call("MODULE", "LIST")
14+
module_graph = modules.detect { |_name_key, name, _ver_key, _ver| name == 'graph' }
15+
raise ServerError, "RedisGraph module not loaded." if module_graph.nil?
1516
end
1617
end

0 commit comments

Comments
 (0)