Sha256: fe6a80b72d8248aa418b473528b4a7874b316a2723a5b83ce0dea02d20cb52f6

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

describe Ppl::Format::AddressBook::PostalAddresses do
  describe "#initialize" do
    it "should pass the colors through to the table" do
      colors = {"id" => "blue"}
      Ppl::Format::Table.should_receive(:new).with([:id, :address_ids], colors)
      format = Ppl::Format::AddressBook::PostalAddresses.new(colors)
    end
  end
end

describe Ppl::Format::AddressBook::PostalAddresses do

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

    @address.id = "home"
    @contact.id = "test"
    @contact.postal_addresses << @address
    @format.table = @table

    @address_book.contacts.push(@contact)
  end

  describe "#process" do

    it "shows the contact's and address' IDs" do
      @table.should_receive(:add_row).with({
        :id          => "test:",
        :address_ids => "home",
      })
      @format.process(@address_book)
    end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ppl-3.0.1 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-3.0.0 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.4.1 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.4.0 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.3.3 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.3.2 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.3.1 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.3.0 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.2.0 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.1.0 spec/ppl/format/address_book/postal_addresses_spec.rb
ppl-2.0.0 spec/ppl/format/address_book/postal_addresses_spec.rb