spec/lib/sources/mongo_spec.rb in picky-3.5.4 vs spec/lib/sources/mongo_spec.rb in picky-3.6.0
- old
+ new
@@ -1,32 +1,32 @@
require 'spec_helper'
describe Picky::Sources::Mongo do
-
+
describe 'key_format' do
context 'default' do
let(:source) { described_class.new(:a, :b, :url => 'someurl', :db => 'somedb') }
it 'is correct' do
- source.key_format.should == :to_sym
+ source.key_format.should == :to_s
end
end
context 'non-default' do
let(:source) { described_class.new(:a, :b, :url => 'bla', :db => 'somedb', :key_format => 'some_key_method') }
it 'is correct' do
source.key_format.should == :some_key_method
end
end
end
-
+
describe 'to_s' do
let(:source) { described_class.new(:a, :b, :url => 'someurl', :db => 'somedb') }
it 'is correct' do
source.to_s.should == 'Picky::Sources::Mongo'
end
end
-
+
context "without database" do
it "should fail correctly" do
lambda { @source = described_class.new(:a, :b, :url => 'someurl') }.should raise_error(described_class::NoDBGiven)
end
end
@@ -39,10 +39,10 @@
describe "harvest" do
it "yields the right data" do
category = stub :b, :from => :b, :index_name => :some_index_name
@source.harvest category do |id, token|
- id.should eql('7f')
+ id.should eql('7f')
token.should eql('b data')
end.should have(1).item
end
end
end