picky 4.11.0 → 4.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,15 +16,38 @@ describe 'Multi Index Qualifiers' do
16
16
 
17
17
  person = Struct.new :id, :title, :name
18
18
  book = Struct.new :id, :title, :subtitle
19
-
20
- people.add person.new(1, 'mister', 'pedro maria alhambra madrugada')
21
19
 
22
- books.add book.new(2, 'the mister madrugada affair', 'the story of seventeen madrugada family members')
20
+ people.add person.new(1, 'mister', 'pedro maria alhambra madrugada')
21
+ books.add book.new( 2, 'the mister madrugada affair', 'the story of seventeen madrugada family members')
23
22
 
24
23
  try = Picky::Search.new people, books
25
24
 
25
+ # We expect title to be mapped to:
26
+ # * the title category in index people
27
+ # * the title category in index books
28
+ #
29
+ # Resulting in mister being found in both.
30
+ #
26
31
  try.search('title:mister').ids.should == [1, 2]
32
+
33
+ # This is a bit crazier.
34
+ #
35
+ # We expect name to be mapped to:
36
+ # * the name category in index people
37
+ # * the title category in index books
38
+ #
39
+ # Resulting in madrugada being found in both.
40
+ #
27
41
  try.search('name:madrugada').ids.should == [1, 2]
42
+
43
+ # If either would not work correctly, we would find:
44
+ # try.search('title:mister').ids.should == [1, 1]
45
+ # or
46
+ # try.search('title:mister').ids.should == [2, 2]
47
+ # since "title" would be resolved to the same
48
+ # category in both cases.
49
+ #
50
+ # Or possibly get [1, 2, 2], if title is simply ignored.
28
51
  end
29
52
 
30
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picky
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.0
4
+ version: 4.11.1
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: 2012-11-02 00:00:00.000000000 Z
12
+ date: 2012-11-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 4.11.0
37
+ version: 4.11.1
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 4.11.0
45
+ version: 4.11.1
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: text
48
48
  requirement: !ruby/object:Gem::Requirement