Sha256: 38d1156baab16460fd8603dcd147f25bb7e525ac6e854c936708f9d00e91393c

Contents?: true

Size: 939 Bytes

Versions: 5

Compression:

Stored size: 939 Bytes

Contents

describe Ppl::Format::AddressBook::EmailAddresses do

  before(:each) do
    @format       = Ppl::Format::AddressBook::EmailAddresses.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({
        :contact_id      => "test:",
        :email_addresses => "",
      })
      @format.process(@address_book)
    end

    it "should show an email address if it's available" do
      @contact.email_addresses.push "jdoe@example.org"
      @table.should_receive(:add_row).with({
        :contact_id      => "test:",
        :email_addresses => "jdoe@example.org",
      })
      @format.process(@address_book)
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

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