Sha256: 18d87286a2719b7c4a44627d8c05351a391a7b0b535a59fe51bb6a84a854da35

Contents?: true

Size: 1.55 KB

Versions: 3

Compression:

Stored size: 1.55 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
      allow(@storage).to receive(:load_contact) do |id| end
      expect{@storage.require_contact("joe")}.to raise_error(Ppl::Error::ContactNotFound)
    end

    it "should return the loaded contact" do
      allow(@storage).to receive(:load_contact) do |id| Object.new end
      expect(@storage.require_contact("joe")).to 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

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

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ppl-4.0.5 spec/ppl/adapter/storage_spec.rb
ppl-4.0.3 spec/ppl/adapter/storage_spec.rb
ppl-4.0.2 spec/ppl/adapter/storage_spec.rb