Sha256: baf78a418930dccdeee6604c319436844e91f58ee355d077dc274b71faa68e71

Contents?: true

Size: 946 Bytes

Versions: 12

Compression:

Stored size: 946 Bytes

Contents

describe Ppl::Format::Custom::PhoneNumber do

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

  describe "%n" do
    it "should output the number itself" do
      @number.number = "1234567890"
      @format.format = "tel: %n"
      @format.process(@number).should eq "tel: 1234567890"
    end
  end

  describe "%t" do
    it "should output the type of the number" do
      @number.type = "cell"
      @format.format = "(%t)"
      @format.process(@number).should eq "(cell)"
    end
  end

  describe "%f" do
    before(:each) do
      @format.format = "%f"
    end
    it "should output a star if the number is preferred" do
      @number.preferred = true
      @format.process(@number).should eq "*"
    end
    it "should output nothing if the number is not preferred" do
      @number.preferred = false
      @format.process(@number).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/phone_number_spec.rb
ppl-3.0.0 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.4.1 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.4.0 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.3.3 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.3.2 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.3.1 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.3.0 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.2.0 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.1.0 spec/ppl/format/custom/phone_number_spec.rb
ppl-2.0.0 spec/ppl/format/custom/phone_number_spec.rb
ppl-1.25.0 spec/ppl/format/custom/phone_number_spec.rb