spec/lib/sources/wrappers/base_spec.rb in picky-2.1.2 vs spec/lib/sources/wrappers/base_spec.rb in picky-2.2.0
- old
+ new
@@ -1,39 +1,38 @@
require 'spec_helper'
describe Sources::Wrappers::Base do
before(:each) do
- @backend = stub :backend
- @category = stub :category, :source => @backend
+ @source = stub :source
end
context "with backend" do
it "doesn't fail" do
- lambda { Sources::Wrappers::Base.new(@category) }.should_not raise_error
+ lambda { described_class.new(@source) }.should_not raise_error
end
before(:each) do
- @wrapper = Sources::Wrappers::Base.new @category
+ @wrapper = described_class.new @source
end
it "delegates harvest" do
- @backend.should_receive(:harvest).once.with :some_type, :some_field
+ @source.should_receive(:harvest).once.with :some_category
- @wrapper.harvest :some_type, :some_field
+ @wrapper.harvest :some_category
end
it "delegates take_snapshot" do
- @backend.should_receive(:take_snapshot).once.with :some_type
+ @source.should_receive(:take_snapshot).once.with :some_index
- @wrapper.take_snapshot :some_type
+ @wrapper.take_snapshot :some_index
end
it "delegates connect_backend" do
- @backend.should_receive(:connect_backend).once.with # nothing
+ @source.should_receive(:connect_backend).once.with # nothing
@wrapper.connect_backend
end
end
context "without backend" do
it "fails" do
- lambda { Sources::Wrappers::Base.new }.should raise_error(ArgumentError)
+ lambda { described_class.new }.should raise_error(ArgumentError)
end
end
end
\ No newline at end of file