Sha256: 60ff95ab07bb0bd5ed61ce94a47ed546cb1b2a9b639091783942f164919a3547

Contents?: true

Size: 963 Bytes

Versions: 10

Compression:

Stored size: 963 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_address = "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

10 entries across 10 versions & 1 rubygems

Version Path
ppl-1.3.0 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.2.0 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.1.0 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.0.6 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.0.5 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.0.4 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.0.3 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.0.1 spec/ppl/format/address_book/one_line_spec.rb
ppl-1.0.0 spec/ppl/format/address_book/one_line_spec.rb
ppl-0.9.0 spec/ppl/format/address_book/one_line_spec.rb