sunspot_matchers 1.3.0.2 → 2.0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -69,10 +69,10 @@ class SunspotMatchersTest < Test::Unit::TestCase
69
69
  keywords 'terrible pizza'
70
70
  end
71
71
 
72
- assert_has_search_params Sunspot.session, :keywords, Proc.new {
72
+ assert_has_search_params Sunspot.session, :keywords do
73
73
  keywords 'great pizza'
74
74
  keywords 'terrible pizza'
75
- }
75
+ end
76
76
  end
77
77
 
78
78
  def test_allow_any_match_keyword
@@ -108,46 +108,46 @@ class SunspotMatchersTest < Test::Unit::TestCase
108
108
  with :author_name, 'Mark Twain'
109
109
  with :author_name, 'John Twain'
110
110
  end
111
- assert_has_search_params Sunspot.session, :with, Proc.new {
111
+ assert_has_search_params Sunspot.session, :with do
112
112
  with :author_name, 'Mark Twain'
113
113
  with :author_name, 'John Twain'
114
- }
114
+ end
115
115
  end
116
116
 
117
117
  def test_with_matcher_matches_greater_than
118
118
  Sunspot.search(Post) do
119
119
  with(:category_ids).greater_than(1)
120
120
  end
121
- assert_has_search_params Sunspot.session, :with, Proc.new {
121
+ assert_has_search_params Sunspot.session, :with do
122
122
  with(:category_ids).greater_than(1)
123
- }
123
+ end
124
124
  end
125
125
 
126
126
  def test_with_matcher_matches_less_than
127
127
  Sunspot.search(Post) do
128
128
  with(:category_ids).less_than(1)
129
129
  end
130
- assert_has_search_params Sunspot.session, :with, Proc.new {
130
+ assert_has_search_params Sunspot.session, :with do
131
131
  with(:category_ids).less_than(1)
132
- }
132
+ end
133
133
  end
134
134
 
135
135
  def test_with_matcher_matches_range
136
136
  Sunspot.search(Post) do
137
137
  with :category_ids, 1..3
138
138
  end
139
- assert_has_search_params Sunspot.session, :with, Proc.new {
139
+ assert_has_search_params Sunspot.session, :with do
140
140
  with :category_ids, 1..3
141
- }
141
+ end
142
142
  end
143
143
 
144
144
  def test_with_matcher_matches_any_of
145
145
  Sunspot.search(Post) do
146
146
  with(:category_ids).any_of [ 1, 2 ]
147
147
  end
148
- assert_has_search_params Sunspot.session, :with, Proc.new {
148
+ assert_has_search_params Sunspot.session, :with do
149
149
  with(:category_ids).any_of [ 1, 2 ]
150
- }
150
+ end
151
151
  end
152
152
 
153
153
  def test_with_matcher_matches_any_of_multiline
@@ -157,12 +157,12 @@ class SunspotMatchersTest < Test::Unit::TestCase
157
157
  with :category_ids, 2
158
158
  end
159
159
  end
160
- assert_has_search_params Sunspot.session, :with, Proc.new {
160
+ assert_has_search_params Sunspot.session, :with do
161
161
  any_of do
162
162
  with :category_ids, 1
163
163
  with :category_ids, 2
164
164
  end
165
- }
165
+ end
166
166
  end
167
167
 
168
168
  def test_with_matcher_matches_any_of_and_all_of
@@ -175,7 +175,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
175
175
  end
176
176
  end
177
177
  end
178
- assert_has_search_params Sunspot.session, :with, Proc.new {
178
+ assert_has_search_params Sunspot.session, :with do
179
179
  any_of do
180
180
  with :category_ids, 1
181
181
  all_of do
@@ -183,7 +183,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
183
183
  with :category_ids, 3
184
184
  end
185
185
  end
186
- }
186
+ end
187
187
  end
188
188
 
189
189
  def test_with_matcher_matches_any_param_match
@@ -235,46 +235,46 @@ class SunspotMatchersTest < Test::Unit::TestCase
235
235
  without :author_name, 'Mark Twain'
236
236
  without :author_name, 'John Twain'
237
237
  end
238
- assert_has_search_params Sunspot.session, :without, Proc.new {
238
+ assert_has_search_params Sunspot.session, :without do
239
239
  without :author_name, 'Mark Twain'
240
240
  without :author_name, 'John Twain'
241
- }
241
+ end
242
242
  end
243
243
 
244
244
  def test_without_matcher_matches_greater_than
245
245
  Sunspot.search(Post) do
246
246
  without(:category_ids).greater_than(1)
247
247
  end
248
- assert_has_search_params Sunspot.session, :without, Proc.new {
248
+ assert_has_search_params Sunspot.session, :without do
249
249
  without(:category_ids).greater_than(1)
250
- }
250
+ end
251
251
  end
252
252
 
253
253
  def test_without_matcher_matches_less_than
254
254
  Sunspot.search(Post) do
255
255
  without(:category_ids).less_than(1)
256
256
  end
257
- assert_has_search_params Sunspot.session, :without, Proc.new {
257
+ assert_has_search_params Sunspot.session, :without do
258
258
  without(:category_ids).less_than(1)
259
- }
259
+ end
260
260
  end
261
261
 
262
262
  def test_without_matcher_matches_range
263
263
  Sunspot.search(Post) do
264
264
  without :category_ids, 1..3
265
265
  end
266
- assert_has_search_params Sunspot.session, :without, Proc.new {
266
+ assert_has_search_params Sunspot.session, :without do
267
267
  without :category_ids, 1..3
268
- }
268
+ end
269
269
  end
270
270
 
271
271
  def test_without_matcher_matches_any_of
272
272
  Sunspot.search(Post) do
273
273
  without(:category_ids).any_of [ 1, 2 ]
274
274
  end
275
- assert_has_search_params Sunspot.session, :without, Proc.new {
275
+ assert_has_search_params Sunspot.session, :without do
276
276
  without(:category_ids).any_of [ 1, 2 ]
277
- }
277
+ end
278
278
  end
279
279
 
280
280
  def test_without_matcher_matches_any_of_multiline
@@ -284,12 +284,12 @@ class SunspotMatchersTest < Test::Unit::TestCase
284
284
  without :category_ids, 2
285
285
  end
286
286
  end
287
- assert_has_search_params Sunspot.session, :without, Proc.new {
287
+ assert_has_search_params Sunspot.session, :without do
288
288
  any_of do
289
289
  without :category_ids, 1
290
290
  without :category_ids, 2
291
291
  end
292
- }
292
+ end
293
293
  end
294
294
 
295
295
  def test_without_matcher_matches_any_of_and_all_of
@@ -302,7 +302,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
302
302
  end
303
303
  end
304
304
  end
305
- assert_has_search_params Sunspot.session, :without, Proc.new {
305
+ assert_has_search_params Sunspot.session, :without do
306
306
  any_of do
307
307
  without :category_ids, 1
308
308
  all_of do
@@ -310,7 +310,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
310
310
  without :category_ids, 3
311
311
  end
312
312
  end
313
- }
313
+ end
314
314
  end
315
315
 
316
316
  def test_without_matcher_matches_any_param_match
@@ -390,10 +390,10 @@ class SunspotMatchersTest < Test::Unit::TestCase
390
390
  order_by :published_at, :asc
391
391
  order_by :average_rating, :asc
392
392
  end
393
- assert_has_search_params Sunspot.session, :order_by, Proc.new {
393
+ assert_has_search_params Sunspot.session, :order_by do
394
394
  order_by :published_at, :asc
395
395
  order_by :average_rating, :asc
396
- }
396
+ end
397
397
  end
398
398
 
399
399
  def test_order_by_matcher_doesnt_match_multiple_reversed
@@ -401,10 +401,10 @@ class SunspotMatchersTest < Test::Unit::TestCase
401
401
  order_by :average_rating, :asc
402
402
  order_by :published_at, :asc
403
403
  end
404
- assert_has_no_search_params Sunspot.session, :order_by, Proc.new {
404
+ assert_has_no_search_params Sunspot.session, :order_by do
405
405
  order_by :published_at, :asc
406
406
  order_by :average_rating, :asc
407
- }
407
+ end
408
408
  end
409
409
 
410
410
  def test_order_by_matcher_matches_on_random
@@ -412,10 +412,10 @@ class SunspotMatchersTest < Test::Unit::TestCase
412
412
  order_by :average_rating, :asc
413
413
  order_by :random
414
414
  end
415
- assert_has_search_params Sunspot.session, :order_by, Proc.new {
415
+ assert_has_search_params Sunspot.session, :order_by do
416
416
  order_by :average_rating, :asc
417
417
  order_by :random
418
- }
418
+ end
419
419
  end
420
420
 
421
421
  def test_order_by_matcher_doesnt_match_without_random
@@ -423,9 +423,9 @@ class SunspotMatchersTest < Test::Unit::TestCase
423
423
  order_by :average_rating, :asc
424
424
  order_by :random
425
425
  end
426
- assert_has_no_search_params Sunspot.session, :order_by, Proc.new {
426
+ assert_has_no_search_params Sunspot.session, :order_by do
427
427
  order_by :average_rating, :asc
428
- }
428
+ end
429
429
  end
430
430
 
431
431
  def test_order_by_matcher_with_score
@@ -433,10 +433,10 @@ class SunspotMatchersTest < Test::Unit::TestCase
433
433
  order_by :average_rating, :asc
434
434
  order_by :score
435
435
  end
436
- assert_has_search_params Sunspot.session, :order_by, Proc.new {
436
+ assert_has_search_params Sunspot.session, :order_by do
437
437
  order_by :average_rating, :asc
438
438
  order_by :score
439
- }
439
+ end
440
440
  end
441
441
 
442
442
  def test_order_by_matcher_doesnt_match_without_score
@@ -444,9 +444,9 @@ class SunspotMatchersTest < Test::Unit::TestCase
444
444
  order_by :average_rating, :asc
445
445
  order_by :score
446
446
  end
447
- assert_has_no_search_params Sunspot.session, :order_by, Proc.new {
447
+ assert_has_no_search_params Sunspot.session, :order_by do
448
448
  order_by :average_rating, :asc
449
- }
449
+ end
450
450
  end
451
451
 
452
452
  def test_order_by_matcher_respects_any_param_on_direction
@@ -512,10 +512,10 @@ class SunspotMatchersTest < Test::Unit::TestCase
512
512
  category_filter = with(:category_ids, 2)
513
513
  facet(:category_ids, :exclude => category_filter)
514
514
  end
515
- assert_has_search_params Sunspot.session, :facet, Proc.new {
515
+ assert_has_search_params Sunspot.session, :facet do
516
516
  category_filter = with(:category_ids, 2)
517
517
  facet(:category_ids, :exclude => category_filter)
518
- }
518
+ end
519
519
  end
520
520
 
521
521
  def test_query_facet_matcher_matches
@@ -529,7 +529,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
529
529
  end
530
530
  end
531
531
  end
532
- assert_has_search_params Sunspot.session, :facet, Proc.new {
532
+ assert_has_search_params Sunspot.session, :facet do
533
533
  facet(:average_rating) do
534
534
  row(1.0..2.0) do
535
535
  with(:average_rating, 1.0..2.0)
@@ -538,7 +538,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
538
538
  with(:average_rating, 2.0..3.0)
539
539
  end
540
540
  end
541
- }
541
+ end
542
542
  end
543
543
 
544
544
  def test_query_facet_matcher_doesnt_match_missing_facet
@@ -549,7 +549,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
549
549
  end
550
550
  end
551
551
  end
552
- assert_has_no_search_params Sunspot.session, :facet, Proc.new {
552
+ assert_has_no_search_params Sunspot.session, :facet do
553
553
  facet(:average_rating) do
554
554
  row(1.0..2.0) do
555
555
  with(:average_rating, 1.0..2.0)
@@ -558,7 +558,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
558
558
  with(:average_rating, 2.0..3.0)
559
559
  end
560
560
  end
561
- }
561
+ end
562
562
  end
563
563
 
564
564
  def test_query_facet_matcher_doesnt_match_different_query
@@ -572,7 +572,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
572
572
  end
573
573
  end
574
574
  end
575
- assert_has_no_search_params Sunspot.session, :facet, Proc.new {
575
+ assert_has_no_search_params Sunspot.session, :facet do
576
576
  facet(:average_rating) do
577
577
  row(1.0..2.0) do
578
578
  with(:average_rating, 1.0..2.0)
@@ -581,7 +581,7 @@ class SunspotMatchersTest < Test::Unit::TestCase
581
581
  with(:average_rating, 2.0..4.0)
582
582
  end
583
583
  end
584
- }
584
+ end
585
585
  end
586
586
 
587
587
  # 'boost' matcher
@@ -592,11 +592,11 @@ class SunspotMatchersTest < Test::Unit::TestCase
592
592
  boost_fields :body => 2.0
593
593
  end
594
594
  end
595
- assert_has_search_params Sunspot.session, :boost, Proc.new {
595
+ assert_has_search_params Sunspot.session, :boost do
596
596
  keywords 'great pizza' do
597
597
  boost_fields :body => 2.0
598
598
  end
599
- }
599
+ end
600
600
  end
601
601
 
602
602
  def test_boost_matcher_doesnt_match_on_boost_mismatch
@@ -605,11 +605,11 @@ class SunspotMatchersTest < Test::Unit::TestCase
605
605
  boost_fields :body => 2.0
606
606
  end
607
607
  end
608
- assert_has_no_search_params Sunspot.session, :boost, Proc.new {
608
+ assert_has_no_search_params Sunspot.session, :boost do
609
609
  keywords 'great pizza' do
610
610
  boost_fields :body => 3.0
611
611
  end
612
- }
612
+ end
613
613
  end
614
614
 
615
615
  def test_boost_matcher_matches_boost_query
@@ -620,13 +620,13 @@ class SunspotMatchersTest < Test::Unit::TestCase
620
620
  end
621
621
  end
622
622
  end
623
- assert_has_search_params Sunspot.session, :boost, Proc.new {
623
+ assert_has_search_params Sunspot.session, :boost do
624
624
  keywords 'great pizza' do
625
625
  boost(2.0) do
626
626
  with :blog_id, 4
627
627
  end
628
628
  end
629
- }
629
+ end
630
630
  end
631
631
 
632
632
  def test_boost_matcher_doesnt_match_on_boost_query_mismatch
@@ -637,13 +637,13 @@ class SunspotMatchersTest < Test::Unit::TestCase
637
637
  end
638
638
  end
639
639
  end
640
- assert_has_no_search_params Sunspot.session, :boost, Proc.new {
640
+ assert_has_no_search_params Sunspot.session, :boost do
641
641
  keywords 'great pizza' do
642
642
  boost(2.0) do
643
643
  with :blog_id, 5
644
644
  end
645
645
  end
646
- }
646
+ end
647
647
  end
648
648
 
649
649
  def test_boost_matcher_matches_boost_function
@@ -652,11 +652,11 @@ class SunspotMatchersTest < Test::Unit::TestCase
652
652
  boost(function { sum(:average_rating, product(:popularity, 10)) })
653
653
  end
654
654
  end
655
- assert_has_search_params Sunspot.session, :boost, Proc.new {
655
+ assert_has_search_params Sunspot.session, :boost do
656
656
  keywords 'great pizza' do
657
657
  boost(function { sum(:average_rating, product(:popularity, 10)) })
658
658
  end
659
- }
659
+ end
660
660
  end
661
661
 
662
662
  def test_boost_matcher_doesnt_match_on_boost_function_mismatch
@@ -665,11 +665,11 @@ class SunspotMatchersTest < Test::Unit::TestCase
665
665
  boost(function { sum(:average_rating, product(:popularity, 10)) })
666
666
  end
667
667
  end
668
- assert_has_no_search_params Sunspot.session, :boost, Proc.new {
668
+ assert_has_no_search_params Sunspot.session, :boost do
669
669
  keywords 'great pizza' do
670
670
  boost(function { sum(:average_rating, product(:popularity, 42)) })
671
671
  end
672
- }
672
+ end
673
673
  end
674
674
 
675
675
  # 'be a search for'
metadata CHANGED
@@ -1,96 +1,87 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sunspot_matchers
3
- version: !ruby/object:Gem::Version
4
- hash: 67
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 3
9
- - 0
10
- - 2
11
- version: 1.3.0.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0.0
5
+ prerelease:
12
6
  platform: ruby
13
- authors:
7
+ authors:
14
8
  - Joseph Palermo
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2012-06-25 00:00:00 -07:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
12
+ date: 2013-04-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
23
15
  name: bundler
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
26
17
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 23
31
- segments:
32
- - 1
33
- - 0
34
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
35
21
  version: 1.0.0
36
22
  type: :development
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: rspec
40
23
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
42
25
  none: false
43
- requirements:
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.0.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
44
35
  - - ~>
45
- - !ruby/object:Gem::Version
46
- hash: 31
47
- segments:
48
- - 2
49
- - 4
50
- - 0
36
+ - !ruby/object:Gem::Version
51
37
  version: 2.4.0
52
38
  type: :development
53
- version_requirements: *id002
54
- - !ruby/object:Gem::Dependency
55
- name: sunspot
56
39
  prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
58
41
  none: false
59
- requirements:
42
+ requirements:
60
43
  - - ~>
61
- - !ruby/object:Gem::Version
62
- hash: 27
63
- segments:
64
- - 1
65
- - 3
66
- - 0
67
- version: 1.3.0
44
+ - !ruby/object:Gem::Version
45
+ version: 2.4.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: sunspot
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 2.0.0
68
54
  type: :development
69
- version_requirements: *id003
70
- - !ruby/object:Gem::Dependency
71
- name: rake
72
55
  prerelease: false
73
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.0.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
74
65
  none: false
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- hash: 3
79
- segments:
80
- - 0
81
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
82
70
  type: :development
83
- version_requirements: *id004
84
- description: These matchers and assertions allow you to test what is happening inside the Sunspot Search DSL blocks
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: These matchers and assertions allow you to test what is happening inside
79
+ the Sunspot Search DSL blocks
85
80
  email: []
86
-
87
81
  executables: []
88
-
89
82
  extensions: []
90
-
91
83
  extra_rdoc_files: []
92
-
93
- files:
84
+ files:
94
85
  - .gitignore
95
86
  - Gemfile
96
87
  - Gemfile.lock
@@ -105,41 +96,29 @@ files:
105
96
  - spec/sunspot_matchers_spec.rb
106
97
  - sunspot_matchers.gemspec
107
98
  - test/sunspot_matchers_test.rb
108
- has_rdoc: true
109
99
  homepage: https://github.com/pivotal/sunspot_matchers
110
- licenses:
100
+ licenses:
111
101
  - MIT
112
102
  post_install_message:
113
103
  rdoc_options: []
114
-
115
- require_paths:
104
+ require_paths:
116
105
  - lib
117
- required_ruby_version: !ruby/object:Gem::Requirement
106
+ required_ruby_version: !ruby/object:Gem::Requirement
118
107
  none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- hash: 3
123
- segments:
124
- - 0
125
- version: "0"
126
- required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
113
  none: false
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- hash: 23
132
- segments:
133
- - 1
134
- - 3
135
- - 6
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
136
117
  version: 1.3.6
137
118
  requirements: []
138
-
139
119
  rubyforge_project:
140
- rubygems_version: 1.3.7
120
+ rubygems_version: 1.8.24
141
121
  signing_key:
142
122
  specification_version: 3
143
123
  summary: RSpec matchers and Test::Unit assertions for testing Sunspot
144
124
  test_files: []
145
-