cypher_builder 0.0.4 → 0.0.5

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: 875bb9cde808a0014d2d16a22bbba9f9fa050f32
4
- data.tar.gz: a8dc8091e8b7862273da2c20d81b9c1a956c5e0d
3
+ metadata.gz: 26225a58b1717350bda4fd81a734c492f7e60747
4
+ data.tar.gz: 31ccce0aaf2a0fbd9c720de956993b190b1381cc
5
5
  SHA512:
6
- metadata.gz: 1f67659909ed0a09587c0779e491980e4cd7745f9a83e6a14065c6b0f45cee962106b32863267b219ccd8450bdadfd849a41191854f3a674115823bd0207d6f8
7
- data.tar.gz: 270f94f3052508ff0ac7ad7d74a63fb68a2b335eb4eb860fb033eea4eb0dfb6e1d330274e849624fb36a3c2a0dfed5a83e643ef6b745a599f81f492a550350e9
6
+ metadata.gz: 502ee59e86a94dd2bd5740b4e543ea0a2cfbc7e13fc3c1153ca6fe3579e3bd20414227e0d30b2568418d6df05305bf2de1062e5c8e0b7f476112cbf253e126d4
7
+ data.tar.gz: 74fd3360304f6f6a8c799f2eddbc584538f9a60a44cced4eec5d84a9d98755b0ef20fce25e4f747665f9b99715befdbc7eca3d55a7a6289101e9837a5f56c65e
@@ -11,7 +11,7 @@ module CypherBuilder
11
11
  end
12
12
 
13
13
  def as_cypher(payload:, context: )
14
- resolve(@parts, format: 'MATCH %s', separator: ', ', payload: payload, context: context.add(self))
14
+ 'MATCH ' + resolve(@parts, separator: ', ', payload: payload, context: context.add(self))
15
15
  end
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module CypherBuilder
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -35,16 +35,17 @@ describe Cypher do
35
35
  end
36
36
  it 'executes the most complex query possible (exercises everything currently implemented)' do
37
37
  c = Node('c', labels: 'what')
38
+ v = Node('v', labels: 'other')
38
39
  n = Node('n')
39
40
  r = Rel('r')
40
- cypher_class = Cypher(Match(r.from(c).to(n)),
41
+ cypher_class = Cypher(Match(r.from(c).to(n), v),
41
42
  Where(And(Eql(c.stuff, Param('thing')),
42
43
  Like(c.staff, 'test%'))),
43
44
  Return(c.name, Alias(c.stuff, 'something')),
44
45
  OrderBy(c.name, :desc, c.stuff),
45
46
  Limit(10))
46
47
  cypher_class.new(adapter).execute(thing: 'of course')
47
- expect(adapter).to have_received(:execute).with('MATCH (c:what)-[r]->(n) WHERE c.stuff = {thing} AND c.staff LIKE "test%" RETURN c.name AS name, c.stuff AS something ORDER BY c.name desc, c.stuff LIMIT 10', {thing: 'of course'})
48
+ expect(adapter).to have_received(:execute).with('MATCH (c:what)-[r]->(n), (v:other) WHERE c.stuff = {thing} AND c.staff LIKE "test%" RETURN c.name AS name, c.stuff AS something ORDER BY c.name desc, c.stuff LIMIT 10', {thing: 'of course'})
48
49
  end
49
50
  context 'with Opt' do
50
51
  before do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypher_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronie Uliana
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-22 00:00:00.000000000 Z
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler