Skip to content

Commit

Permalink
Merge branch 'v1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed Apr 14, 2012
2 parents d98477d + 6e42518 commit 01156d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/thinking_sphinx/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def initialize(*args)
populate if @options[:populate]
end

def ==(object)
populate
super
end

def to_a
populate
@array
Expand Down
9 changes: 9 additions & 0 deletions spec/thinking_sphinx/search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
end
end

describe '#==' do
it "populates the search results when checking equality" do
search = ThinkingSphinx::Search.new
search == []

search.should be_populated
end
end

describe '#populated?' do
before :each do
@search = ThinkingSphinx::Search.new
Expand Down

0 comments on commit 01156d4

Please sign in to comment.