Sha256: 3028962f7b639d7641593969a0e237193eccb6d4a5e791a64c8cb5b49d8c258d

Contents?: true

Size: 968 Bytes

Versions: 8

Compression:

Stored size: 968 Bytes

Contents

describe Ppl::Format::AddressBook::OneLine do

  before(:each) do
    @format       = Ppl::Format::AddressBook::OneLine.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.add_contact(@contact)
  end

  describe "#process" do

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

    it "should show all the info if it's available" do
      @contact.name = "John Doe"
      @contact.email_addresses.push "jdoe@example.org"
      @table.should_receive(:add_row).with({
        :id    => "test:",
        :name  => "John Doe",
        :email => "<jdoe@example.org>",
      })
      @format.process(@address_book)
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ppl-1.8.0 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.7.0 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.6.0 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.5.3 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.5.2 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.5.1 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.5.0 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.4.1 spec/ppl/format/address_book/one_line_spec.rb