Sha256: 54c4d755b8edb3df1b8dcfc3d57766fd1251a70aeb8a36711925ca729d793e0d

Contents?: true

Size: 1.38 KB

Versions: 22

Compression:

Stored size: 1.38 KB

Contents

describe Ppl::Adapter::Storage do

  before(:each) do
    @storage = Ppl::Adapter::Storage.new
  end

  describe "#create_address_book" do
    it "should raise not implemented error" do
      expect{Ppl::Adapter::Storage.create_address_book(nil)}.to raise_error(NotImplementedError)
    end
  end

  describe "#delete_contact" do
    it "should raise not implemented error" do
      expect{@storage.delete_contact(nil)}.to raise_error(NotImplementedError)
    end
  end

  describe "#load_address_book" do
    it "should raise not implemented error" do
      expect{@storage.load_address_book}.to raise_error(NotImplementedError)
    end
  end

  describe "#load_contact" do
    it "should raise not implemented error" do
      expect{@storage.load_contact(nil)}.to raise_error(NotImplementedError)
    end
  end

  describe "#require_contact" do

    it "should raise Ppl::Error::ContactNotFound if load fails" do
      @storage.stub(:load_contact) do |id| end
      expect{@storage.require_contact("joe")}.to raise_error(Ppl::Error::ContactNotFound)
    end

    it "should return the loaded contact" do
      @storage.stub(:load_contact) do |id| Object.new end
      @storage.require_contact("joe").should be_an(Object)
    end
  end

  describe "#save_contact" do
    it "should raise not implemented error" do
      expect{@storage.save_contact(nil)}.to raise_error(NotImplementedError)
    end
  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ppl-1.0.0 spec/ppl/adapter/storage_spec.rb
ppl-0.9.0 spec/ppl/adapter/storage_spec.rb