Sha256: 65328fc3173cb301f063c39c2fea3759b44e16fc4074e66d440fcbfbbce657e0

Contents?: true

Size: 931 Bytes

Versions: 22

Compression:

Stored size: 931 Bytes

Contents

require 'spec_helper'

describe Picky::Sources::Wrappers::Base do
  
  before(:each) do
    @source = stub :source
  end
  
  context "with backend" do
    it "doesn't fail" do
      lambda { described_class.new(@source) }.should_not raise_error
    end
    before(:each) do
      @wrapper = described_class.new @source
    end
    it "delegates harvest" do
      @source.should_receive(:harvest).once.with :some_category
      
      @wrapper.harvest :some_category
    end
    it "delegates take_snapshot" do
      @source.should_receive(:take_snapshot).once.with :some_index
      
      @wrapper.take_snapshot :some_index
    end
    it "delegates connect_backend" do
      @source.should_receive(:connect_backend).once.with # nothing
      
      @wrapper.connect_backend
    end
  end
  context "without backend" do
    it "fails" do
      lambda { described_class.new }.should raise_error(ArgumentError)
    end
  end
  
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
picky-3.2.0 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.13 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.12 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.11 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.10 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.9 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.8 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.7 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.6 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.5 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.4 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.3 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.2 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.1 spec/lib/sources/wrappers/base_spec.rb
picky-3.1.0 spec/lib/sources/wrappers/base_spec.rb
picky-3.0.1 spec/lib/sources/wrappers/base_spec.rb
picky-3.0.0 spec/lib/sources/wrappers/base_spec.rb
picky-3.0.0.pre5 spec/lib/sources/wrappers/base_spec.rb
picky-3.0.0.pre4 spec/lib/sources/wrappers/base_spec.rb
picky-3.0.0.pre3 spec/lib/sources/wrappers/base_spec.rb