sunspot_matchers 2.0.0.3 → 2.0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,14 @@ module SunspotMatchers
|
|
18
18
|
attr_accessor :searches
|
19
19
|
|
20
20
|
def initialize(original_session)
|
21
|
+
# Support Sunspot random field in test -- Sunspot originally generate a random number for the field
|
22
|
+
# Only patch method if SunspotSessionSpy is initialized to prevent poisoning class simply by being included in Gemfile.
|
23
|
+
Sunspot::Query::Sort::RandomSort.class_eval do
|
24
|
+
define_method :to_param do
|
25
|
+
"random #{direction_for_solr}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
21
29
|
@searches = []
|
22
30
|
@original_session = original_session
|
23
31
|
@config = Sunspot::Configuration.build
|
@@ -102,11 +110,4 @@ module SunspotMatchers
|
|
102
110
|
end
|
103
111
|
end
|
104
112
|
end
|
105
|
-
end
|
106
|
-
|
107
|
-
# Support Sunspot random field in test -- Sunspot originally generate a random number for the field
|
108
|
-
class Sunspot::Query::Sort::RandomSort < Sunspot::Query::Sort::Abstract
|
109
|
-
def to_param
|
110
|
-
"random #{direction_for_solr}"
|
111
|
-
end
|
112
113
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunspot_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -110,9 +110,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- - ! '>='
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
|
-
segments:
|
114
|
-
- 0
|
115
|
-
hash: -1436965995018875279
|
116
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
114
|
none: false
|
118
115
|
requirements:
|
@@ -121,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
118
|
version: 1.3.6
|
122
119
|
requirements: []
|
123
120
|
rubyforge_project:
|
124
|
-
rubygems_version: 1.8.
|
121
|
+
rubygems_version: 1.8.23
|
125
122
|
signing_key:
|
126
123
|
specification_version: 3
|
127
124
|
summary: RSpec matchers and Test::Unit assertions for testing Sunspot
|