Sha256: cd1d6f08b446286484d4ab397c3bd036fcc0533f0b3381e826a354fdaf9750e7

Contents?: true

Size: 888 Bytes

Versions: 4

Compression:

Stored size: 888 Bytes

Contents

describe Ppl::Format::AddressBook::Ages do

  before(:each) do
    @format       = Ppl::Format::AddressBook::Ages.new
    @address_book = Ppl::Entity::AddressBook.new
    @contact      = Ppl::Entity::Contact.new
    @table        = double(Ppl::Format::Table)
    @contact.id   = "test"
    @format.table = @table
    @format.date  = Date.parse("1980-01-02")
    @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({
        :id  => "test:",
        :age => "",
      })
      @format.process(@address_book)
    end

    it "should show an age if it's available" do
      @contact.birthday = Date.parse("1970-01-01")
      @table.should_receive(:add_row).with({
        :id  => "test:",
        :age => "10",
      })
      @format.process(@address_book)
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

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