Sha256: e92ab70fab72627af7236e565391d3220faa25a1be39c814e176be2f737ba47a

Contents?: true

Size: 552 Bytes

Versions: 4

Compression:

Stored size: 552 Bytes

Contents

describe Ppl::Format::Contact::Age do

  before(:each) do
    @format  = Ppl::Format::Contact::Age.new
    @contact = double(Ppl::Entity::Contact)
  end

  describe "#process" do

    it "should return an empty string if the contact lacks a birth date" do
      @contact.should_receive(:age).and_return(nil)
      @format.process(@contact).should eq ""
    end

    it "should return the contact's age if the birthdate is known" do
      @contact.should_receive(:age).and_return(10)
      @format.process(@contact).should eq "10"
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ppl-1.14.1 spec/ppl/format/contact/age_spec.rb
ppl-1.14.0 spec/ppl/format/contact/age_spec.rb
ppl-1.13.0 spec/ppl/format/contact/age_spec.rb
ppl-1.12.0 spec/ppl/format/contact/age_spec.rb