Sha256: 6d93849515d717da126b0907b399d103648b7fcc692e5ac933673ad5b61af6e2

Contents?: true

Size: 918 Bytes

Versions: 6

Compression:

Stored size: 918 Bytes

Contents

describe Ppl::Format::AddressBook::Organizations do

  before(:each) do
    @format       = Ppl::Format::AddressBook::Organizations.new
    @address_book = Ppl::Entity::AddressBook.new
    @contact      = Ppl::Entity::Contact.new
    @table        = double(Ppl::Format::Table)

    @contact.id = "test"
    @format.table = @table

    @address_book.contacts.push(@contact)
  end

  describe "#process" do

    it "should at least show the contact's id" do
      @table.should_receive(:add_row).with({
        :id            => "test:",
        :organizations => "",
      })
      @format.process(@address_book)
    end

    it "should show the organization if it's available" do
      @contact.organizations.push("Example Ltd")
      @table.should_receive(:add_row).with({
        :id            => "test:",
        :organizations => "Example Ltd",
      })
      @format.process(@address_book)
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ppl-1.14.1 spec/ppl/format/address_book/organizations_spec.rb
ppl-1.14.0 spec/ppl/format/address_book/organizations_spec.rb
ppl-1.13.0 spec/ppl/format/address_book/organizations_spec.rb
ppl-1.12.0 spec/ppl/format/address_book/organizations_spec.rb
ppl-1.11.0 spec/ppl/format/address_book/organizations_spec.rb
ppl-1.10.0 spec/ppl/format/address_book/organizations_spec.rb