Sha256: b52e4f8b10302e1e0187f3631acc3889c4543bbd96b6b9bdfe3465c69c0b72ea

Contents?: true

Size: 1.52 KB

Versions: 30

Compression:

Stored size: 1.52 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

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

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ppl-3.0.1 spec/ppl/adapter/storage_spec.rb
ppl-3.0.0 spec/ppl/adapter/storage_spec.rb
ppl-2.4.1 spec/ppl/adapter/storage_spec.rb
ppl-2.4.0 spec/ppl/adapter/storage_spec.rb
ppl-2.3.3 spec/ppl/adapter/storage_spec.rb
ppl-2.3.2 spec/ppl/adapter/storage_spec.rb
ppl-2.3.1 spec/ppl/adapter/storage_spec.rb
ppl-2.3.0 spec/ppl/adapter/storage_spec.rb
ppl-2.2.0 spec/ppl/adapter/storage_spec.rb
ppl-2.1.0 spec/ppl/adapter/storage_spec.rb
ppl-2.0.0 spec/ppl/adapter/storage_spec.rb
ppl-1.25.0 spec/ppl/adapter/storage_spec.rb
ppl-1.24.0 spec/ppl/adapter/storage_spec.rb
ppl-1.23.0 spec/ppl/adapter/storage_spec.rb
ppl-1.22.2 spec/ppl/adapter/storage_spec.rb
ppl-1.22.1 spec/ppl/adapter/storage_spec.rb
ppl-1.22.0 spec/ppl/adapter/storage_spec.rb
ppl-1.21.0 spec/ppl/adapter/storage_spec.rb
ppl-1.20.0 spec/ppl/adapter/storage_spec.rb
ppl-1.19.0 spec/ppl/adapter/storage_spec.rb