neo4j-rspec 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/lib/neo4j/rspec/compat.rb +8 -4
- data/lib/neo4j/rspec/matchers/has_n.rb +15 -1
- data/lib/neo4j/rspec/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5c894999b6ba8f7fcc4e7b22b06d634d985deb8
|
|
4
|
+
data.tar.gz: 73369c8c52ed122844c13af580cba671cf282d6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7f34194b8200c9318e88a95444db50068abd1d55703a538354fd86841ef277734fae913cbfef90b47edd0f283b70ea3b62cac2a933b3bc84b7d2677048741eac
|
|
7
|
+
data.tar.gz: 6704e438e836c1574d748e36c4d5f7b73729132ec427af31b0bc9e03fa502eec0acf780e57ade2202e8494f1184ce2efbb790e8ba2b854a0bfc744772c90efd1
|
data/.travis.yml
CHANGED
data/lib/neo4j/rspec/compat.rb
CHANGED
|
@@ -3,10 +3,14 @@ module Neo4j
|
|
|
3
3
|
module Compat
|
|
4
4
|
class << self
|
|
5
5
|
def current
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
current_class.new
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
private
|
|
10
|
+
|
|
11
|
+
def current_class
|
|
12
|
+
gem_version = Gem::Version.new(Neo4j::VERSION)
|
|
13
|
+
gem_version >= Gem::Version.new('7.0.0') ? Neo4jrb7 : Neo4jrb6
|
|
10
14
|
end
|
|
11
15
|
end
|
|
12
16
|
|
|
@@ -43,7 +43,7 @@ module Neo4j
|
|
|
43
43
|
|
|
44
44
|
class ModelClassMatcher < Base
|
|
45
45
|
def match(association)
|
|
46
|
-
actual =
|
|
46
|
+
actual = association.target_classes.map { |m| m.to_s.to_sym }
|
|
47
47
|
actual & expected == actual
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -51,6 +51,16 @@ module Neo4j
|
|
|
51
51
|
"with #{expected.join(', ')} model class"
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
|
+
|
|
55
|
+
class RelationshipClassMatcher < Base
|
|
56
|
+
def match(association)
|
|
57
|
+
association.relationship_class_name.to_sym == expected.to_sym
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def description
|
|
61
|
+
"with #{expected} relationship class"
|
|
62
|
+
end
|
|
63
|
+
end
|
|
54
64
|
end
|
|
55
65
|
|
|
56
66
|
module Without
|
|
@@ -122,6 +132,10 @@ module Neo4j
|
|
|
122
132
|
matchers.push With::ModelClassMatcher.new(model_classes)
|
|
123
133
|
end
|
|
124
134
|
|
|
135
|
+
chain :with_rel_class do |rel_class|
|
|
136
|
+
matchers.push With::RelationshipClassMatcher.new(rel_class)
|
|
137
|
+
end
|
|
138
|
+
|
|
125
139
|
chain :without_type do
|
|
126
140
|
matchers.push Without::TypeMatcher.new
|
|
127
141
|
end
|
data/lib/neo4j/rspec/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: neo4j-rspec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Denis Tataurov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-08-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: neo4j
|
|
@@ -86,4 +86,3 @@ signing_key:
|
|
|
86
86
|
specification_version: 4
|
|
87
87
|
summary: RSpec matchers for Neo4j.rb
|
|
88
88
|
test_files: []
|
|
89
|
-
has_rdoc:
|