spec/lib/query/live_spec.rb in picky-0.10.5 vs spec/lib/query/live_spec.rb in picky-0.11.0
- old
+ new
@@ -3,16 +3,17 @@
describe Query::Live do
before(:each) do
# @category1 = Index::Category.new
# @type_index = Index::Type.new :some_name, :some_result_type, @category1
- @index = stub :index
+ @type = stub :type
+ @index = stub :index, :index => @type
end
describe 'result_type' do
before(:each) do
- @query = Query::Live.new 'some query', 0, @index
+ @query = Query::Live.new @index
end
it "should return a specific type" do
@query.result_type.should == Results::Live
end
end
@@ -38,10 +39,10 @@
end
describe "results_from" do
describe "with empty ids" do
before(:each) do
- @query = Query::Live.new 'some query', @index
+ @query = Query::Live.new @index
@allocations = stub :allocations, :total => 0, :ids => [], :to_result => :some_results, :process! => nil
end
it "should generate a result" do
@query.results_from(@allocations).should be_kind_of Results::Live
end
\ No newline at end of file