Sha256: 3d636ec924cb334903b74a6770566a75522edee45766acad071171da2ca7a763

Contents?: true

Size: 890 Bytes

Versions: 7

Compression:

Stored size: 890 Bytes

Contents

describe Ppl::Format::AddressBook::Birthdays do

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

    it "should show the birthday if it's available" do
      @contact.birthday = Date.parse("2001-02-03")
      @table.should_receive(:add_row).with({
        :id        => "test:",
        :birthday  => "2001-02-03",
      })
      @format.process(@address_book)
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ppl-1.14.1 spec/ppl/format/address_book/birthdays_spec.rb
ppl-1.14.0 spec/ppl/format/address_book/birthdays_spec.rb
ppl-1.13.0 spec/ppl/format/address_book/birthdays_spec.rb
ppl-1.12.0 spec/ppl/format/address_book/birthdays_spec.rb
ppl-1.11.0 spec/ppl/format/address_book/birthdays_spec.rb
ppl-1.10.0 spec/ppl/format/address_book/birthdays_spec.rb
ppl-1.9.0 spec/ppl/format/address_book/birthdays_spec.rb