sunspot_matchers 2.1.1.0 → 2.1.1.1
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/Gemfile.lock +16 -11
- data/lib/sunspot_matchers/matchers.rb +5 -1
- data/lib/sunspot_matchers/test_helper.rb +2 -5
- data/lib/sunspot_matchers/version.rb +1 -1
- data/spec/sunspot_matchers_spec.rb +12 -1
- data/sunspot_matchers.gemspec +1 -1
- data/test/sunspot_matchers_test.rb +1 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc88959ffa78a318aa2d62ba86b2f6c705a3dee6
|
4
|
+
data.tar.gz: 824335cb1d2666ac6f89988a3e83648315f00ef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01db4c36185a4bb873f4581fbfd1b65de29cdc441b60a7882de3db1334a04940dc9d662bba83e8d5de1a05262e86cb5b4e81b774a8a062c4949e80e81551bb22
|
7
|
+
data.tar.gz: a3d1ed05461237b7707a9651cd37b1191d3cd391580dc7696c1b6a214ea92cb74cd6d58b80518e5bcdbb81cc720f905efcf5bfa5fa04f68761daee26ba47e40f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sunspot_matchers (2.1.1.
|
4
|
+
sunspot_matchers (2.1.1.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -9,17 +9,22 @@ GEM
|
|
9
9
|
builder (3.2.2)
|
10
10
|
diff-lcs (1.2.5)
|
11
11
|
pr_geohash (1.0.0)
|
12
|
-
rake (10.
|
12
|
+
rake (10.4.2)
|
13
13
|
rsolr (1.0.10)
|
14
14
|
builder (>= 2.1.2)
|
15
|
-
rspec (2.
|
16
|
-
rspec-core (~> 2.
|
17
|
-
rspec-expectations (~> 2.
|
18
|
-
rspec-mocks (~> 2.
|
19
|
-
rspec-core (2.
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
rspec (3.2.0)
|
16
|
+
rspec-core (~> 3.2.0)
|
17
|
+
rspec-expectations (~> 3.2.0)
|
18
|
+
rspec-mocks (~> 3.2.0)
|
19
|
+
rspec-core (3.2.0)
|
20
|
+
rspec-support (~> 3.2.0)
|
21
|
+
rspec-expectations (3.2.0)
|
22
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
23
|
+
rspec-support (~> 3.2.0)
|
24
|
+
rspec-mocks (3.2.0)
|
25
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
+
rspec-support (~> 3.2.0)
|
27
|
+
rspec-support (3.2.1)
|
23
28
|
sunspot (2.1.1)
|
24
29
|
pr_geohash (~> 1.0)
|
25
30
|
rsolr (~> 1.0.7)
|
@@ -30,6 +35,6 @@ PLATFORMS
|
|
30
35
|
DEPENDENCIES
|
31
36
|
bundler (>= 1.0.0)
|
32
37
|
rake
|
33
|
-
rspec
|
38
|
+
rspec
|
34
39
|
sunspot (~> 2.1.1)
|
35
40
|
sunspot_matchers!
|
@@ -313,6 +313,10 @@ module SunspotMatchers
|
|
313
313
|
def failure_message_when_negated
|
314
314
|
"expected search class: #{search_types.join(' and ')} NOT to match expected class: #{@expected_class}"
|
315
315
|
end
|
316
|
+
|
317
|
+
def description
|
318
|
+
"be a search for #{@expected_class}"
|
319
|
+
end
|
316
320
|
end
|
317
321
|
|
318
322
|
def be_a_search_for(expected_class)
|
@@ -332,7 +336,7 @@ module SunspotMatchers
|
|
332
336
|
end
|
333
337
|
|
334
338
|
def description
|
335
|
-
"
|
339
|
+
"have searchable field '#{@field}'"
|
336
340
|
end
|
337
341
|
|
338
342
|
def failure_message
|
@@ -1,13 +1,10 @@
|
|
1
1
|
require 'sunspot'
|
2
|
+
require 'minitest/autorun'
|
2
3
|
require File.expand_path('../matchers', __FILE__)
|
3
4
|
require File.expand_path('../sunspot_session_spy', __FILE__)
|
4
5
|
module SunspotMatchers
|
5
6
|
class HaveSearchParamsForSession
|
6
|
-
|
7
|
-
include MiniTest::Assertions
|
8
|
-
else
|
9
|
-
include Test::Unit::Assertions
|
10
|
-
end
|
7
|
+
include MiniTest::Assertions
|
11
8
|
|
12
9
|
def initialize(session, method, *args, &block)
|
13
10
|
@session = session
|
@@ -762,7 +762,6 @@ describe "Sunspot Matchers" do
|
|
762
762
|
expect(Sunspot.session).to_not have_search_params(:group, :author_name)
|
763
763
|
end
|
764
764
|
end
|
765
|
-
|
766
765
|
end
|
767
766
|
|
768
767
|
describe "be_a_search_for" do
|
@@ -772,6 +771,12 @@ describe "Sunspot Matchers" do
|
|
772
771
|
end
|
773
772
|
end
|
774
773
|
|
774
|
+
it "provides a description" do
|
775
|
+
expected_class = Post
|
776
|
+
description = "be a search for #{expected_class}"
|
777
|
+
expect(be_a_search_for(expected_class).description).to eq description
|
778
|
+
end
|
779
|
+
|
775
780
|
it "succeeds if the model is correct" do
|
776
781
|
expect(Sunspot.session).to be_a_search_for(Post)
|
777
782
|
end
|
@@ -804,6 +809,12 @@ describe "Sunspot Matchers" do
|
|
804
809
|
end
|
805
810
|
|
806
811
|
describe "have_searchable_field" do
|
812
|
+
it "provides a description" do
|
813
|
+
field_name = :author_name
|
814
|
+
description = "have searchable field '#{field_name}'"
|
815
|
+
expect(have_searchable_field(field_name).description).to eq description
|
816
|
+
end
|
817
|
+
|
807
818
|
it "works with instances as well as classes" do
|
808
819
|
expect(Post).to have_searchable_field(:body)
|
809
820
|
end
|
data/sunspot_matchers.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.required_rubygems_version = ">= 1.3.6"
|
16
16
|
|
17
17
|
s.add_development_dependency "bundler", ">= 1.0.0"
|
18
|
-
s.add_development_dependency "rspec"
|
18
|
+
s.add_development_dependency "rspec"
|
19
19
|
s.add_development_dependency "sunspot", "~> 2.1.1"
|
20
20
|
s.add_development_dependency "rake"
|
21
21
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler'
|
3
3
|
require 'sunspot_matchers/test_helper'
|
4
|
-
require 'test/unit'
|
5
4
|
|
6
5
|
class Post; end
|
7
6
|
class Blog; end
|
@@ -23,7 +22,7 @@ Sunspot.setup(Blog) do
|
|
23
22
|
string :name
|
24
23
|
end
|
25
24
|
|
26
|
-
class SunspotMatchersTest <
|
25
|
+
class SunspotMatchersTest < MiniTest::Unit::TestCase
|
27
26
|
include SunspotMatchers::TestHelper
|
28
27
|
|
29
28
|
def setup
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunspot_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.1.
|
4
|
+
version: 2.1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Palermo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sunspot
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|