test/graph_test.rb in redgraph-0.1.2 vs test/graph_test.rb in redgraph-0.1.3
- old
+ new
@@ -10,15 +10,17 @@
def teardown
@graph.delete
end
def test_list
+ skip unless graph_list_supported?
list = @graph.list
assert_includes(list, "foobar")
end
def test_delete
+ skip unless graph_list_supported?
assert_includes(@graph.list, "foobar")
@graph.delete
refute_includes(@graph.list, "foobar")
end
@@ -63,7 +65,18 @@
"GRAPH.QUERY",
name,
"CREATE (:actor {name: 'hello'})"
)
graph
+ end
+
+ # This command is only supported in the latest version
+ def graph_list_supported?
+ @graph.list
+ rescue Redis::CommandError => e
+ if e.message =~ /ERR unknown command `GRAPH.LIST`/
+ false
+ else
+ true
+ end
end
end