neo4j-rspec 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 933b93a35b254e73872753e5ef6cdb9104cd5488
4
- data.tar.gz: 69ffc3297f2a4f79a693c504d19bd71eb1cf9ba9
3
+ metadata.gz: c5c894999b6ba8f7fcc4e7b22b06d634d985deb8
4
+ data.tar.gz: 73369c8c52ed122844c13af580cba671cf282d6b
5
5
  SHA512:
6
- metadata.gz: 0a43c59c457eac06e4f03cd72a0954e97f1e269838555a2a760bdc50a900170be97c276ac33381cd6b7937b92c64f99a8866be70c83500f36b52611c4ca1084b
7
- data.tar.gz: 42689d8cfe8a976bbde57788916584fe47dcf3e96cb1808e40b87c13acffb5c28ab94d18242de26872f0544bc26eb79eb9a39981e3460b1af53c1cf22e72037f
6
+ metadata.gz: 7f34194b8200c9318e88a95444db50068abd1d55703a538354fd86841ef277734fae913cbfef90b47edd0f283b70ea3b62cac2a933b3bc84b7d2677048741eac
7
+ data.tar.gz: 6704e438e836c1574d748e36c4d5f7b73729132ec427af31b0bc9e03fa502eec0acf780e57ade2202e8494f1184ce2efbb790e8ba2b854a0bfc744772c90efd1
data/.travis.yml CHANGED
@@ -10,5 +10,5 @@ env:
10
10
  global:
11
11
  - TRAVISCI=1
12
12
  matrix:
13
- - NEO4J_VERSION=6.0.0
14
- - NEO4J_VERSION=7.0.0
13
+ - NEO4J_VERSION=6.0.9
14
+ - NEO4J_VERSION=7.0.11
@@ -3,10 +3,14 @@ module Neo4j
3
3
  module Compat
4
4
  class << self
5
5
  def current
6
- case Neo4j::VERSION
7
- when /^6/ then Neo4jrb6.new
8
- when /^7/ then Neo4jrb7.new
9
- end
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 = Array(association.model_class)
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
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module RSpec
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
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.3
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-04-19 00:00:00.000000000 Z
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: