adapter-elasticsearch 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,10 +4,6 @@ ElasticSearch adapter for adapter gem.
4
4
 
5
5
  See examples/ or specs/ for usage.
6
6
 
7
- ## ToDo
8
-
9
- * add spec for :parent option
10
-
11
7
  ## Note on Patches/Pull Requests
12
8
 
13
9
  * Fork the project.
@@ -1,5 +1,5 @@
1
1
  module Adapter
2
2
  module ElasticSearch
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -15,4 +15,21 @@ describe Adapter::ElasticSearch do
15
15
  let(:adapter) { @adapter }
16
16
 
17
17
  it_should_behave_like 'an elasticsearch adapter'
18
+
19
+ describe "#write" do
20
+ context "with parent" do
21
+ let(:adapter) { Adapter[:elasticsearch].new(@client, {:type => 'document', :parent => :library}) }
22
+
23
+ it "sets parent parameter" do
24
+ params = {'foo' => 'bar', 'library' => '2'}
25
+ @client.should_receive(:add).with('document', '123', params, :parent => '2')
26
+ adapter.write('123', params)
27
+ end
28
+
29
+ it "does not set parent on non-hash values" do
30
+ @client.should_receive(:add).with('document', '123', {'_value' => '456'}, {})
31
+ adapter.write('123', '456')
32
+ end
33
+ end
34
+ end
18
35
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adapter-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jonathan Hoyt