picky 4.12.1 → 4.12.2
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.
- data/lib/picky/backends/backend.rb +5 -3
- data/lib/picky/backends/file/basic.rb +1 -1
- data/lib/picky/backends/file/json.rb +1 -1
- data/lib/picky/backends/file.rb +5 -4
- data/lib/picky/backends/memory.rb +4 -4
- data/lib/picky/backends/prepared/text.rb +2 -0
- data/lib/picky/backends/redis.rb +1 -1
- data/lib/picky/bundle.rb +3 -3
- data/lib/picky/categories.rb +24 -14
- data/lib/picky/categories_convenience.rb +1 -2
- data/lib/picky/categories_indexed.rb +2 -4
- data/lib/picky/categories_indexing.rb +4 -4
- data/lib/picky/categories_realtime.rb +7 -7
- data/lib/picky/character_substituters/west_european.rb +1 -1
- data/lib/picky/extensions/class.rb +4 -4
- data/lib/picky/extensions/module.rb +29 -7
- data/lib/picky/index.rb +26 -25
- data/lib/picky/index_convenience.rb +1 -3
- data/lib/picky/index_indexed.rb +5 -5
- data/lib/picky/index_indexing.rb +2 -6
- data/lib/picky/index_realtime.rb +7 -7
- data/lib/picky/indexers/base.rb +2 -2
- data/lib/picky/indexes.rb +12 -17
- data/lib/picky/indexes_convenience.rb +1 -3
- data/lib/picky/indexes_indexed.rb +2 -5
- data/lib/picky/indexes_indexing.rb +2 -6
- data/lib/picky/loader.rb +1 -0
- data/lib/picky/query/allocation.rb +1 -1
- data/lib/picky/query/allocations.rb +7 -7
- data/lib/picky/query/boosts.rb +1 -2
- data/lib/picky/query/combinations.rb +3 -3
- data/lib/picky/query/indexes.rb +18 -18
- data/lib/picky/query/token.rb +1 -1
- data/lib/picky/query/tokens.rb +2 -2
- data/lib/picky/rack/harakiri.rb +1 -1
- data/lib/picky/results.rb +2 -2
- data/lib/picky/search.rb +5 -5
- data/lib/picky/search_facets.rb +3 -3
- data/lib/picky/sinatra.rb +1 -1
- data/lib/picky/tokenizer/regexp_wrapper.rb +19 -0
- data/lib/picky/tokenizer.rb +2 -13
- data/lib/picky/wrappers/bundle/delegators.rb +44 -44
- data/lib/picky/wrappers/bundle/wrapper.rb +1 -1
- data/lib/picky.rb +0 -2
- data/lib/tasks/server.rake +2 -1
- data/spec/functional/backends/redis_bundle_realtime_spec.rb +1 -1
- data/spec/functional/backends/sqlite_bundle_realtime_spec.rb +1 -1
- data/spec/functional/custom_delimiters_spec.rb +0 -2
- data/spec/functional/facets_spec.rb +1 -1
- data/spec/lib/backends/backend_spec.rb +1 -1
- data/spec/lib/backends/file/basic_spec.rb +1 -1
- data/spec/lib/backends/file_spec.rb +1 -1
- data/spec/lib/backends/memory/json_spec.rb +1 -1
- data/spec/lib/backends/memory/marshal_spec.rb +1 -1
- data/spec/lib/backends/redis/float_spec.rb +1 -1
- data/spec/lib/backends/redis/string_spec.rb +1 -1
- data/spec/lib/backends/sqlite/array_spec.rb +2 -2
- data/spec/lib/backends/sqlite/value_spec.rb +1 -1
- data/spec/lib/category_indexing_spec.rb +1 -1
- data/spec/lib/extensions/module_spec.rb +43 -6
- data/spec/lib/index_indexed_spec.rb +2 -2
- data/spec/lib/index_spec.rb +22 -1
- data/spec/lib/indexers/base_spec.rb +1 -1
- data/spec/lib/indexes_indexing_spec.rb +2 -2
- data/spec/lib/query/allocation_spec.rb +3 -3
- data/spec/lib/query/allocations_spec.rb +6 -6
- data/spec/lib/query/combinations_spec.rb +1 -1
- data/spec/lib/query/tokens_spec.rb +13 -13
- data/spec/lib/results_spec.rb +2 -2
- data/spec/lib/search_spec.rb +4 -4
- data/spec/lib/sinatra_spec.rb +2 -2
- metadata +5 -4
data/lib/picky/query/indexes.rb
CHANGED
@@ -13,9 +13,7 @@ module Picky
|
|
13
13
|
#
|
14
14
|
class Indexes
|
15
15
|
|
16
|
-
|
17
|
-
:first,
|
18
|
-
:to => :@indexes
|
16
|
+
forward :size, :first, :to => :@indexes
|
19
17
|
|
20
18
|
attr_reader :indexes,
|
21
19
|
:ignored_categories
|
@@ -30,21 +28,23 @@ module Picky
|
|
30
28
|
|
31
29
|
@indexes = indexes
|
32
30
|
end
|
33
|
-
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
31
|
+
|
32
|
+
# TODO Reinstate.
|
33
|
+
#
|
34
|
+
# # Ignore the categories with these qualifiers.
|
35
|
+
# #
|
36
|
+
# # Example:
|
37
|
+
# # search = Search.new(index1, index2, index3) do
|
38
|
+
# # ignore :name, :first_name
|
39
|
+
# # end
|
40
|
+
# #
|
41
|
+
# # Note: Cleans up / optimizes after being called.
|
42
|
+
# #
|
43
|
+
# def ignore *qualifiers
|
44
|
+
# @ignored_categories ||= []
|
45
|
+
# @ignored_categories += qualifiers.map { |qualifier| @qualifier_mapper.map qualifier }.compact
|
46
|
+
# @ignored_categories.uniq!
|
47
|
+
# end
|
48
48
|
|
49
49
|
# Returns a number of prepared (sorted, reduced etc.) allocations for the given tokens.
|
50
50
|
#
|
data/lib/picky/query/token.rb
CHANGED
data/lib/picky/query/tokens.rb
CHANGED
@@ -10,9 +10,9 @@ module Picky
|
|
10
10
|
|
11
11
|
attr_reader :tokens, :ignore_unassigned
|
12
12
|
|
13
|
-
# Basically
|
13
|
+
# Basically forwards to its internal tokens array.
|
14
14
|
#
|
15
|
-
|
15
|
+
forward *[Enumerable.instance_methods, :slice!, :[], :uniq!, :last, :reject!, :length, :size, :empty?, :each, :exit, :to => :@tokens].flatten
|
16
16
|
|
17
17
|
# Create a new Tokens object with the array of tokens passed in.
|
18
18
|
#
|
data/lib/picky/rack/harakiri.rb
CHANGED
@@ -28,7 +28,7 @@ module Rack
|
|
28
28
|
|
29
29
|
# #call interface method.
|
30
30
|
#
|
31
|
-
# Harakiri is a middleware, so it
|
31
|
+
# Harakiri is a middleware, so it forwards the the app or
|
32
32
|
# the next middleware after checking if it is time to honorably retire.
|
33
33
|
#
|
34
34
|
def call env
|
data/lib/picky/results.rb
CHANGED
@@ -41,7 +41,7 @@ module Picky
|
|
41
41
|
allocations.process!(amount, offset, extra_allocations)
|
42
42
|
end
|
43
43
|
|
44
|
-
#
|
44
|
+
# Forwards to allocations.
|
45
45
|
#
|
46
46
|
# Note that this is an expensive call and
|
47
47
|
# should not be done repeatedly. Just keep
|
@@ -51,7 +51,7 @@ module Picky
|
|
51
51
|
allocations.ids only
|
52
52
|
end
|
53
53
|
|
54
|
-
# The total results.
|
54
|
+
# The total results. Forwards to the allocations.
|
55
55
|
#
|
56
56
|
def total
|
57
57
|
@total ||= allocations.total || 0
|
data/lib/picky/search.rb
CHANGED
@@ -23,10 +23,10 @@ module Picky
|
|
23
23
|
attr_accessor :tokenizer,
|
24
24
|
:boosts
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
forward :ignore,
|
27
|
+
:only,
|
28
|
+
:remap_qualifiers,
|
29
|
+
:to => :indexes
|
30
30
|
|
31
31
|
# Takes:
|
32
32
|
# * A number of indexes
|
@@ -213,7 +213,7 @@ module Picky
|
|
213
213
|
unique
|
214
214
|
end
|
215
215
|
|
216
|
-
#
|
216
|
+
# Forwards the tokenizing to the query tokenizer.
|
217
217
|
#
|
218
218
|
# Parameters:
|
219
219
|
# * text: The string to tokenize.
|
data/lib/picky/search_facets.rb
CHANGED
@@ -8,12 +8,12 @@ module Picky
|
|
8
8
|
# category: The category whose facets to return.
|
9
9
|
#
|
10
10
|
# Options
|
11
|
-
# counts: Whether you want counts (returns a Hash) or not (returns an Array).
|
12
|
-
# at_least: A minimum count a facet needs to have (inclusive).
|
11
|
+
# counts: Whether you want counts (returns a Hash) or not (returns an Array). (Default true)
|
12
|
+
# at_least: A minimum count a facet needs to have (inclusive). (Default 1)
|
13
13
|
# filter: A query to filter the facets with.
|
14
14
|
#
|
15
15
|
# Usage:
|
16
|
-
# search.facets :name, filter: 'surname:peter',
|
16
|
+
# search.facets :name, filter: 'surname:peter', at_least: 2
|
17
17
|
#
|
18
18
|
def facets category_identifier, options = {}
|
19
19
|
# TODO Make it work. How should it work with multiple indexes?
|
data/lib/picky/sinatra.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
class RegexpWrapper
|
2
|
+
|
3
|
+
def initialize regexp
|
4
|
+
@regexp = regexp
|
5
|
+
end
|
6
|
+
|
7
|
+
def split text
|
8
|
+
text.split @regexp
|
9
|
+
end
|
10
|
+
|
11
|
+
def source
|
12
|
+
@regexp.source
|
13
|
+
end
|
14
|
+
|
15
|
+
def method_missing name, *args, &block
|
16
|
+
@regexp.send name, *args, &block
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/lib/picky/tokenizer.rb
CHANGED
@@ -105,17 +105,6 @@ Case sensitive? #{@case_sensitive ? "Yes." : "-"}
|
|
105
105
|
RegexpWrapper.new thing
|
106
106
|
end
|
107
107
|
end
|
108
|
-
class RegexpWrapper
|
109
|
-
def initialize regexp
|
110
|
-
@regexp = regexp
|
111
|
-
end
|
112
|
-
def split text
|
113
|
-
text.split @regexp
|
114
|
-
end
|
115
|
-
def source
|
116
|
-
@regexp.source
|
117
|
-
end
|
118
|
-
end
|
119
108
|
def split text
|
120
109
|
@splits_text_on.split text
|
121
110
|
end
|
@@ -124,8 +113,8 @@ Case sensitive? #{@case_sensitive ? "Yes." : "-"}
|
|
124
113
|
#
|
125
114
|
# We only allow arrays.
|
126
115
|
#
|
127
|
-
# TODO 5.0 Rename to normalizes(config)
|
128
|
-
# TODO 5.0 Rename to normalize(text)
|
116
|
+
# TODO 5.0 Rename to normalizes(config) or normalizes_words
|
117
|
+
# TODO 5.0 Rename to normalize(text) or normalize_words
|
129
118
|
#
|
130
119
|
def normalizes_words regexp_replaces
|
131
120
|
raise ArgumentError.new "#{__method__} takes an Array of replaces as argument, not a #{regexp_replaces.class}." unless regexp_replaces.respond_to?(:to_ary) || regexp_replaces.respond_to?(:normalize_with_patterns)
|
@@ -6,66 +6,66 @@ module Picky
|
|
6
6
|
|
7
7
|
module Delegator
|
8
8
|
|
9
|
-
|
9
|
+
forward :add,
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
:inverted,
|
12
|
+
:weights,
|
13
|
+
:similarity,
|
14
|
+
:configuration,
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
:backup,
|
17
|
+
:restore,
|
18
|
+
:delete,
|
19
19
|
|
20
|
-
|
20
|
+
:reset_backend,
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
:raise_unless_cache_exists,
|
23
|
+
:raise_unless_index_exists,
|
24
|
+
:raise_unless_similarity_exists,
|
25
25
|
|
26
|
-
|
26
|
+
:similar,
|
27
27
|
|
28
|
-
|
28
|
+
:to => :bundle
|
29
29
|
|
30
30
|
end
|
31
31
|
|
32
32
|
module IndexingDelegator
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
34
|
+
forward :[]=,
|
35
|
+
:analyze,
|
36
|
+
:dump,
|
37
|
+
:empty,
|
38
|
+
:empty_configuration,
|
39
|
+
:generate_caches_from_memory,
|
40
|
+
:generate_caches_from_source,
|
41
|
+
:generate_partial_from,
|
42
|
+
:retrieve,
|
43
|
+
:size,
|
44
|
+
:to => :bundle
|
45
45
|
|
46
46
|
end
|
47
47
|
|
48
48
|
module IndexedDelegator
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
50
|
+
forward :[],
|
51
|
+
:add_partialized,
|
52
|
+
:clear,
|
53
|
+
:clear_inverted,
|
54
|
+
:clear_weights,
|
55
|
+
:clear_similarity,
|
56
|
+
:clear_configuration,
|
57
|
+
:clear_realtime,
|
58
|
+
:identifier,
|
59
|
+
:ids,
|
60
|
+
:load,
|
61
|
+
:load_inverted,
|
62
|
+
:load_weights,
|
63
|
+
:load_similarity,
|
64
|
+
:load_configuration,
|
65
|
+
:name,
|
66
|
+
:remove,
|
67
|
+
:weight,
|
68
|
+
:to => :bundle
|
69
69
|
|
70
70
|
end
|
71
71
|
|
data/lib/picky.rb
CHANGED
@@ -20,10 +20,8 @@ module Picky
|
|
20
20
|
#
|
21
21
|
# TODO Remove active support.
|
22
22
|
#
|
23
|
-
require 'active_support/core_ext/module/delegation'
|
24
23
|
require 'active_support/core_ext/logger'
|
25
24
|
require 'active_support/core_ext/object/blank'
|
26
|
-
require 'active_support/core_ext/enumerable'
|
27
25
|
require 'active_support/multibyte'
|
28
26
|
require 'multi_json'
|
29
27
|
require 'rack_fast_escape' if defined? Rack
|
data/lib/tasks/server.rake
CHANGED
@@ -16,7 +16,8 @@ namespace :server do
|
|
16
16
|
task :start => :framework do
|
17
17
|
chdir_to_root
|
18
18
|
daemonize = PICKY_ENVIRONMENT == 'production' ? '-D' : ''
|
19
|
-
|
19
|
+
ENV['PICKY_ENV'] = PICKY_ENVIRONMENT
|
20
|
+
command = "unicorn -c unicorn.rb #{daemonize}".strip
|
20
21
|
puts "Running \`#{command}\`."
|
21
22
|
exec command
|
22
23
|
end
|
@@ -167,7 +167,7 @@ describe 'facets' do
|
|
167
167
|
it 'is fast enough' do
|
168
168
|
performance_of {
|
169
169
|
10.times { finder.facets(:age_category, filter: 'surname:meier name:peter', counts: false) }
|
170
|
-
}.should < 0.
|
170
|
+
}.should < 0.0031
|
171
171
|
end
|
172
172
|
it 'has one filtered facet' do
|
173
173
|
finder.facets(:age_category, filter: 'surname:meier name:peter', counts: false).should == ['45']
|
@@ -19,7 +19,7 @@ describe Picky::Backends::File::Basic do
|
|
19
19
|
|
20
20
|
describe 'to_s' do
|
21
21
|
it 'returns the cache path with the default file extension' do
|
22
|
-
basic.to_s.should == 'Picky::Backends::File::Basic(spec/temp/some/cache/path/to/file.file.index,spec/temp/some/cache/path/to/file.file_mapping.
|
22
|
+
basic.to_s.should == 'Picky::Backends::File::Basic(spec/temp/some/cache/path/to/file.file.index,spec/temp/some/cache/path/to/file.file_mapping.memory.json)'
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -38,7 +38,7 @@ describe Picky::Backends::File do
|
|
38
38
|
describe 'create_...' do
|
39
39
|
[
|
40
40
|
[:inverted, Picky::Backends::File::JSON],
|
41
|
-
[:weights, Picky::Backends::
|
41
|
+
[:weights, Picky::Backends::Memory::JSON],
|
42
42
|
[:similarity, Picky::Backends::File::JSON],
|
43
43
|
[:configuration, Picky::Backends::File::JSON]
|
44
44
|
].each do |type, kind|
|
@@ -8,7 +8,7 @@ describe Picky::Backends::SQLite::Array do
|
|
8
8
|
let(:db) { described_class.new 'spec/temp/some/cache/path/to/file' }
|
9
9
|
|
10
10
|
describe 'dump' do
|
11
|
-
it '
|
11
|
+
it 'forwards to the given hash' do
|
12
12
|
hash = stub :hash
|
13
13
|
|
14
14
|
db.should_receive(:dump_sqlite).once.with hash
|
@@ -76,7 +76,7 @@ describe Picky::Backends::SQLite::Array do
|
|
76
76
|
let(:db) { described_class.new 'spec/temp/some/cache/path/to/file', realtime: true }
|
77
77
|
|
78
78
|
describe 'dump' do
|
79
|
-
it '
|
79
|
+
it 'forwards to the given hash' do
|
80
80
|
hash = stub :hash
|
81
81
|
|
82
82
|
db.should_receive(:dump_sqlite).never
|
@@ -8,7 +8,7 @@ describe Picky::Backends::SQLite::Value do
|
|
8
8
|
let(:db) { described_class.new 'spec/temp/some/cache/path/to/file' }
|
9
9
|
|
10
10
|
describe 'dump' do
|
11
|
-
it '
|
11
|
+
it 'forwards to the given hash' do
|
12
12
|
hash = stub :hash
|
13
13
|
|
14
14
|
db.should_receive(:dump_sqlite).once.with hash
|
@@ -2,12 +2,12 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Module do
|
4
4
|
|
5
|
-
describe '
|
5
|
+
describe 'each_forward' do
|
6
6
|
context "with correct params" do
|
7
|
-
|
8
|
-
|
7
|
+
let(:klass) do
|
8
|
+
Class.new do
|
9
9
|
|
10
|
-
|
10
|
+
each_forward :bli, :bla, :blu, :to => :@some_enumerable
|
11
11
|
|
12
12
|
def initialize some_enumerable
|
13
13
|
@some_enumerable = some_enumerable
|
@@ -17,7 +17,7 @@ describe Module do
|
|
17
17
|
end
|
18
18
|
it 'should send each a bli' do
|
19
19
|
bli = stub :bli
|
20
|
-
delegating =
|
20
|
+
delegating = klass.new [bli, bli, bli, bli]
|
21
21
|
|
22
22
|
bli.should_receive(:bli).exactly(4).times
|
23
23
|
|
@@ -25,10 +25,47 @@ describe Module do
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
context "without correct params" do
|
28
|
+
it 'should raise an error' do
|
29
|
+
lambda do
|
30
|
+
Class.new do
|
31
|
+
each_forward :bli, :bla, :blu # :to missing
|
32
|
+
end
|
33
|
+
end.should raise_error(ArgumentError)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe 'forward' do
|
39
|
+
context "with correct params" do
|
40
|
+
let(:klass) do
|
41
|
+
Class.new do
|
42
|
+
|
43
|
+
forward :bli, :bla, :blu, :to => :@some_thing
|
44
|
+
|
45
|
+
def initialize some_thing
|
46
|
+
@some_thing = some_thing
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
28
51
|
it 'should send each a bli' do
|
52
|
+
bli = stub :bli
|
53
|
+
delegating = klass.new bli
|
54
|
+
|
55
|
+
bli.should_receive(:bli).exactly(1).times
|
56
|
+
bli.should_receive(:bla).exactly(1).times
|
57
|
+
bli.should_receive(:blu).exactly(1).times
|
58
|
+
|
59
|
+
delegating.bli
|
60
|
+
delegating.bla
|
61
|
+
delegating.blu
|
62
|
+
end
|
63
|
+
end
|
64
|
+
context "without correct params" do
|
65
|
+
it 'should raise an error' do
|
29
66
|
lambda do
|
30
67
|
Class.new do
|
31
|
-
|
68
|
+
forward :bli, :bla, :blu # :to missing
|
32
69
|
end
|
33
70
|
end.should raise_error(ArgumentError)
|
34
71
|
end
|
@@ -31,14 +31,14 @@ describe Picky::Index do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
describe "load" do
|
34
|
-
it "
|
34
|
+
it "forwards to each category" do
|
35
35
|
@categories.should_receive(:load).once.with
|
36
36
|
|
37
37
|
@index.load
|
38
38
|
end
|
39
39
|
end
|
40
40
|
describe "possible_combinations" do
|
41
|
-
it "
|
41
|
+
it "forwards to the combinator" do
|
42
42
|
@categories.should_receive(:possible_combinations).once.with :some_token
|
43
43
|
|
44
44
|
@index.possible_combinations :some_token
|
data/spec/lib/index_spec.rb
CHANGED
@@ -63,7 +63,7 @@ describe Picky::Index do
|
|
63
63
|
end
|
64
64
|
|
65
65
|
describe 'geo_categories' do
|
66
|
-
it '
|
66
|
+
it 'forwards correctly' do
|
67
67
|
api.should_receive(:ranged_category).once.with :some_lat, 0.00898312, from: :some_lat_from
|
68
68
|
api.should_receive(:ranged_category).once.with :some_lng, 0.01796624, from: :some_lng_from
|
69
69
|
|
@@ -103,6 +103,27 @@ describe Picky::Index do
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
106
|
+
|
107
|
+
describe '#to_stats' do
|
108
|
+
let(:index) do
|
109
|
+
the_source = some_source
|
110
|
+
described_class.new :some_index_name do
|
111
|
+
source the_source
|
112
|
+
category :text1
|
113
|
+
category :text2
|
114
|
+
result_identifier :foobar
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'outputs the stats correctly' do
|
119
|
+
index.to_stats.should == <<-EXPECTED
|
120
|
+
some_index_name (Picky::Index):
|
121
|
+
source: some_source
|
122
|
+
categories: text1, text2
|
123
|
+
result identifier: "foobar"
|
124
|
+
EXPECTED
|
125
|
+
end
|
126
|
+
end
|
106
127
|
end
|
107
128
|
|
108
129
|
end
|
@@ -44,7 +44,7 @@ describe Picky::Indexes do
|
|
44
44
|
indexes.indexes.should == []
|
45
45
|
end
|
46
46
|
end
|
47
|
-
def self.
|
47
|
+
def self.it_forwards_each name
|
48
48
|
describe name do
|
49
49
|
it "calls #{name} on each in order" do
|
50
50
|
@index1.should_receive(name).once.with.ordered
|
@@ -54,7 +54,7 @@ describe Picky::Indexes do
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
57
|
-
|
57
|
+
it_forwards_each :clear
|
58
58
|
end
|
59
59
|
|
60
60
|
end
|