rsolr 1.1.1 → 1.1.2

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: f1b9384b1f2ef6e72d473e3187dc4fac80ff36c5
4
- data.tar.gz: aaef72114662b16961d9b75f7f1e12c4a65c7825
3
+ metadata.gz: e401f0dcdd04d8215eec9b67a1e7c775c41ac7f4
4
+ data.tar.gz: 6e466531f33da1560869ce39586101dfc4bbb08e
5
5
  SHA512:
6
- metadata.gz: b44698cf8eff3161e8c30eb43d11f3d2aadc2a25ea19f049fbdc37702fa4e70d92e3d5aec0e42b657781bb21fccec4e65339173cb804b187f4a9df81807793f0
7
- data.tar.gz: ba8dac4030a6820edcb8caf101ad8656b44a4e63e0fc832077206c85d5838c3316d4230558214a959e419ded36a8db2b246e7d91f75f70b26c317714fdcfd3ac
6
+ metadata.gz: 29a5ac0f898a33e2d8efc2a0b0b7ed618c169e63597dcc283573ae9302183f0ee983ec18e30d3c9dc100bb13e06ff86358d02ad0df91515101efc8a26f82b7f8
7
+ data.tar.gz: 1a509a26c086ffbad2543154106584989d7c40d42b747a422a622ba77fe1dd87202373ae1cd8d10727a0b61b89ad16a5cfcdc5655375ebc7d4b5733d9fa7dcb0
@@ -5,9 +5,8 @@ addons:
5
5
  language: ruby
6
6
  sudo: false
7
7
  rvm:
8
- - 2.3.0
9
- - 2.2.4
10
- - 2.1.8
8
+ - 2.3.1
9
+ - 2.2.5
11
10
  - jruby-9.0.5.0
12
11
 
13
12
  notifications:
@@ -19,3 +18,4 @@ env:
19
18
  global:
20
19
  - JRUBY_OPTS="-J-Xms512m -J-Xmx1024m"
21
20
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
21
+ jdk: oraclejdk8
@@ -1,5 +1,5 @@
1
1
  module RSolr
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -68,6 +68,8 @@ module RSolr::Xml
68
68
  []
69
69
  elsif object.respond_to?(:to_ary)
70
70
  object.to_ary || [object]
71
+ elsif object.is_a? Enumerable
72
+ object
71
73
  else
72
74
  [object]
73
75
  end
@@ -351,7 +351,7 @@ describe "RSolr::Client" do
351
351
  :data => {:q=>'test', :fq=>[0,1]},
352
352
  :headers => {}
353
353
  )
354
- result[:uri].to_s.should match /^http:\/\/localhost:9999\/solr\//
354
+ expect(result[:uri].to_s).to match /^http:\/\/localhost:9999\/solr\//
355
355
  end
356
356
  end
357
357
  end
@@ -21,12 +21,12 @@ describe "RSolr::Connection" do
21
21
 
22
22
  it "raises a custom exception" do
23
23
  http_stub = double("Net:HTTP")
24
- http_stub.stub(:request){ raise(Errno::ECONNREFUSED.new) }
24
+ allow(http_stub).to receive(:request).and_raise(Errno::ECONNREFUSED)
25
25
 
26
- subject.stub(:setup_raw_request){ http_stub }
27
- subject.stub(:http){ Net::HTTP.new("localhost", 80) }
26
+ allow(subject).to receive(:setup_raw_request) { http_stub }
27
+ allow(subject).to receive(:http) { Net::HTTP.new("localhost", 80) }
28
28
 
29
- lambda{ subject.execute(nil,{}) }.should raise_error(RSolr::Error::ConnectionRefused)
29
+ expect { subject.execute(nil, {}) }.to raise_error(RSolr::Error::ConnectionRefused)
30
30
  end
31
31
  end
32
32
 
@@ -61,6 +61,14 @@ describe "RSolr::Xml" do
61
61
  expect(result).to match(%r(boost="10"))
62
62
  expect(result).to match(%r(<field name="id">1</field>))
63
63
  end
64
+
65
+ it 'should work for values that yield enumerators' do
66
+ documents = [{id: 1, cat: ['cat 1', 'cat 2'].to_enum}]
67
+ result = generator.add(documents)
68
+
69
+ expect(result).to match(%r(name="cat">cat 1</field>))
70
+ expect(result).to match(%r(name="cat">cat 2</field>))
71
+ end
64
72
 
65
73
  # add a single hash ("doc")
66
74
  it 'should create an add from a hash' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsolr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antoine Latter
@@ -29,7 +29,7 @@ authors:
29
29
  autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2016-02-22 00:00:00.000000000 Z
32
+ date: 2016-08-19 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: builder
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  requirements: []
197
197
  rubyforge_project: rsolr
198
- rubygems_version: 2.4.5.1
198
+ rubygems_version: 2.5.1
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: A Ruby client for Apache Solr