spec/lib/internals/indexers/serial_spec.rb in picky-2.1.2 vs spec/lib/internals/indexers/serial_spec.rb in picky-2.2.0
- old
+ new
@@ -1,17 +1,15 @@
require 'spec_helper'
describe Indexers::Serial do
before(:each) do
- @index = stub :index, :name => :some_index
- @category = stub :category, :name => :some_category
- @configuration = Configuration::Index.new @index, @category
-
- @source = stub :source
@tokenizer = stub :tokenizer
- @indexer = Indexers::Serial.new @configuration, @source, @tokenizer
+ @source = stub :source
+ @category = stub :category, :identifier => :some_identifier, :tokenizer => @tokenizer, :source => @source
+
+ @indexer = described_class.new @category
@indexer.stub! :timed_exclaim
end
describe 'key_format' do
context 'source has key_format' do
@@ -38,11 +36,11 @@
end
end
describe "indexing_message" do
it "informs the user about what it is going to index" do
- @indexer.should_receive(:timed_exclaim).once.with '"some_index:some_category": Starting indexing.'
+ @indexer.should_receive(:timed_exclaim).once.with '"some_identifier": Starting serial indexing.'
@indexer.indexing_message
end
end
@@ -53,25 +51,19 @@
@indexer.tokenizer
end
end
describe "index" do
- it "should execute! the indexer" do
+ it "should process" do
@indexer.should_receive(:process).once.with
@indexer.index
end
end
describe "source" do
it "returns the one given to is" do
@indexer.source.should == @source
- end
- end
-
- describe "raise_no_source" do
- it "should raise" do
- lambda { @indexer.raise_no_source }.should raise_error(Indexers::NoSourceSpecifiedException)
end
end
describe "chunked" do
\ No newline at end of file