sunspot_matchers 2.2.0.1 → 2.2.0.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: b4e560abc8129dfc0b769b44a0a88f2ada245c9d
4
- data.tar.gz: 4e6f94ce72d1e41b5ed57c945e20cff6a6e2a537
3
+ metadata.gz: 93ef209cdf1b1551de2677ab1aae74fbecc86c79
4
+ data.tar.gz: c8ea87d0e981d7c657aab10e163049ac72183fcb
5
5
  SHA512:
6
- metadata.gz: b9d05dc424e3fbc91b33cb84f2367dee0e96080339bbb8476585aa44c692be904acc663c2e072c5a6f5010c7ae968bcf234ade205265243d3e33009ee69c3bcd
7
- data.tar.gz: f0680ea628d90954c3a9cc2f2fdf5f0cd9837edb9e6955da2e056acabfef5a5ad96c6ff35a1d77b4ab6d2b4a1ee83d64006058791a625e8a99122b828581982e
6
+ metadata.gz: 0a37bd7f78bc341cb1ae84d827ff11596d9791610cfbda858dcac5817e6f29a83f6351ac104bb1e18256eb1a595024474dc584a78a8ff7f99e1fe29cc2b1f5da
7
+ data.tar.gz: 707f51e7b7d17eb74e68589f4ab8efbc3b2d8bcaf6e3a81ebe7de4b17ac27378a3c86772b509093a0331a643e70d9ab24780e6ada855d81845dd4fec43a89a2e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sunspot_matchers (2.2.0.1)
4
+ sunspot_matchers (2.2.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.markdown CHANGED
@@ -93,9 +93,9 @@ block. Keep in mind, that only the expectation type specified as the argument w
93
93
  you specify `keywords` and `with` restrictions in the same block, but you said `have_search_params(:keywords, ...`
94
94
  the `with` restrictions are simply ignored.
95
95
 
96
- Without creative usage of parentheses you can not use do...end blocks to pass multi statement expectations to the matcher
97
- though. Because do...end have such a low binding precedent, the block is passed to the wrong method. Curly syntax blocks
98
- will work though {...}, or you can pass a Proc as the last argument.
96
+ Without creative usage of parentheses you can not use `do...end` blocks to pass multi statement expectations to the matcher
97
+ though. Because `do...end` have such a low binding precedent, the block is passed to the wrong method. Curly syntax blocks
98
+ will work though `{...}`, or you can pass a Proc as the last argument.
99
99
 
100
100
  ### wildcard matching
101
101
 
@@ -171,7 +171,7 @@ You can also specify only page or per_page, both are not required.
171
171
 
172
172
  ### :order_by
173
173
 
174
- Expectations on multiple orderings are supported using using the block format mentioned above.
174
+ Standard ordering expectation:
175
175
 
176
176
  Sunspot.search(Post) do
177
177
  order_by :published_at, :desc
@@ -179,6 +179,18 @@ Expectations on multiple orderings are supported using using the block format me
179
179
 
180
180
  Sunspot.session.should have_search_params(:order_by, :published_at, :desc)
181
181
 
182
+ Expectations on multiple orderings are supported using using the block format:
183
+
184
+ Sunspot.search(Post) do
185
+ order_by :author_name, :asc
186
+ order_by :published_at, :desc
187
+ end
188
+
189
+ Sunspot.session.should have_search_params(:order_by) {
190
+ order_by :author_name, :asc
191
+ order_by :published_at, :desc
192
+ }
193
+
182
194
  ### :facet
183
195
 
184
196
  Standard faceting expectation:
@@ -109,5 +109,9 @@ module SunspotMatchers
109
109
  Sunspot::CompositeSetup.for(types)
110
110
  end
111
111
  end
112
+
113
+ def more_like_this(object, *types, &block)
114
+ new_more_like_this(object, *types, &block)
115
+ end
112
116
  end
113
117
  end
@@ -1,3 +1,3 @@
1
1
  module SunspotMatchers
2
- VERSION = "2.2.0.1"
2
+ VERSION = "2.2.0.2"
3
3
  end
@@ -3,6 +3,9 @@ require 'sunspot_matchers'
3
3
  require 'rspec'
4
4
 
5
5
  describe SunspotMatchers::HaveDynamicField do
6
+ class NotALotGoingOn; end
7
+ class IndexedWithWrongThings; end
8
+
6
9
  let(:matcher) do
7
10
  described_class.new(:field).tap do |matcher|
8
11
  matcher.matches? klass
@@ -10,7 +13,7 @@ describe SunspotMatchers::HaveDynamicField do
10
13
  end
11
14
 
12
15
  context "when a class has no searchable fields" do
13
- let(:klass) { NotALotGoingOn = Class.new }
16
+ let(:klass) { NotALotGoingOn }
14
17
 
15
18
  it "gives Sunspot configuration error" do
16
19
  expect(matcher.failure_message).to match(/Sunspot was not configured/)
@@ -18,7 +21,7 @@ describe SunspotMatchers::HaveDynamicField do
18
21
  end
19
22
 
20
23
  context "when a class has an unexpected searchable field" do
21
- let(:klass) { IndexedWithWrongThings = Class.new }
24
+ let(:klass) { IndexedWithWrongThings }
22
25
  before do
23
26
  Sunspot.setup(klass) { text :parachute }
24
27
  end
@@ -3,6 +3,9 @@ require 'sunspot_matchers'
3
3
  require 'rspec'
4
4
 
5
5
  describe SunspotMatchers::HaveSearchableField do
6
+ class NotALotGoingOn; end
7
+ class IndexedWithWrongThings; end
8
+
6
9
  let(:matcher) do
7
10
  described_class.new(:field).tap do |matcher|
8
11
  matcher.matches? klass
@@ -10,7 +13,7 @@ describe SunspotMatchers::HaveSearchableField do
10
13
  end
11
14
 
12
15
  context "when a class has no searchable fields" do
13
- let(:klass) { NotALotGoingOn = Class.new }
16
+ let(:klass) { NotALotGoingOn }
14
17
 
15
18
  it "gives Sunspot configuration error" do
16
19
  expect(matcher.failure_message).to match(/Sunspot was not configured/)
@@ -18,7 +21,7 @@ describe SunspotMatchers::HaveSearchableField do
18
21
  end
19
22
 
20
23
  context "when a class has an unexpected searchable field" do
21
- let(:klass) { IndexedWithWrongThings = Class.new }
24
+ let(:klass) { IndexedWithWrongThings }
22
25
  before do
23
26
  Sunspot.setup(klass) { text :parachute }
24
27
  end
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.2.0.1
4
+ version: 2.2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Palermo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-29 00:00:00.000000000 Z
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler