Sha256: b0157aa72812808c1bc6329180b0c2f1b15835d5ba41a7fb871fd83b5dce68b2

Contents?: true

Size: 906 Bytes

Versions: 18

Compression:

Stored size: 906 Bytes

Contents

describe Ppl::Format::AddressBook::PhoneNumbers do

  before(:each) do
    @format       = Ppl::Format::AddressBook::PhoneNumbers.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:",
        :phone_number => nil,
      })
      @format.process(@address_book)
    end

    it "should show the phone number if it's available" do
      @contact.phone_number = "01234567890"
      @table.should_receive(:add_row).with({
        :id           => "test:",
        :phone_number => "01234567890",
      })
      @format.process(@address_book)
    end

  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ppl-1.8.0 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.7.0 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.6.0 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.5.3 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.5.2 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.5.1 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.5.0 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.4.1 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.3.0 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.2.0 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.1.0 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.0.6 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.0.5 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.0.4 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.0.3 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.0.1 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-1.0.0 spec/ppl/format/address_book/phone_numbers_spec.rb
ppl-0.9.0 spec/ppl/format/address_book/phone_numbers_spec.rb