polecat 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -54,7 +54,7 @@ class Polecat
54
54
  if query.relation == :and
55
55
  rs.count == query.terms.count
56
56
  else
57
- rs.empty?
57
+ !rs.empty?
58
58
  end
59
59
  end
60
60
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{polecat}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gibheer"]
@@ -51,7 +51,18 @@ describe "IndexSearcher#search" do
51
51
  add(Polecat::Term.new(:name, :eq, 'foobar'))
52
52
  }
53
53
  it "returns a document for a query with multiple terms" do
54
- s.search(q5).count.should == 1
54
+ s.search(q5)[0].id.should == 3
55
+ end
56
+
57
+ let(:q6) {
58
+ Polecat::Query.new(:or).
59
+ add(Polecat::Term.new(:id, :eq, 1)).
60
+ add(Polecat::Term.new(:id, :eq, 2))
61
+ }
62
+ it "returns multiple documents for an 'or' relationship" do
63
+ result = s.search(q6)
64
+ result[0].id.should == 1
65
+ result[1].id.should == 2
55
66
  end
56
67
  end
57
68
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polecat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gibheer