Sha256: a9a357ccc938bc432a3e540de343abcf7525f80f23b131e651d03424a1f94bb3

Contents?: true

Size: 768 Bytes

Versions: 12

Compression:

Stored size: 768 Bytes

Contents

describe Ppl::Format::Custom::EmailAddress do

  before(:each) do
    @format = Ppl::Format::Custom::EmailAddress.new
    @address = Ppl::Entity::EmailAddress.new
  end

  describe "%a" do
    it "should output the address" do
      @address.address = "test@example.org"
      @format.format = "<%a>"
      @format.process(@address).should eq "<test@example.org>"
    end
  end

  describe "%f" do
    before(:each) do
      @format.format = "%f"
    end
    it "should output a star if the address is preferred" do
      @address.preferred = true
      @format.process(@address).should eq "*"
    end
    it "should output nothing if the address is not preferred" do
      @address.preferred = false
      @format.process(@address).should eq ""
    end
  end

end


Version data entries

12 entries across 12 versions & 1 rubygems

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