Sha256: 910976de07a920cca6938ff0c646f9bbdb32ee99c27f0686ec958d17e1a42ef8

Contents?: true

Size: 1.42 KB

Versions: 73

Compression:

Stored size: 1.42 KB

Contents

{
  "number": {
    "description": "Cleanup user-entered phone numbers",
    "cases": [
      {
        "description": "cleans the number",
        "phrase": "(123) 456-7890",
        "expected": "1234567890"
      },
      {
        "description": "cleans numbers with dots",
        "phrase": "123.456.7890",
        "expected": "1234567890"
      },
      {
        "description": "cleans numbers with multiple spaces",
        "phrase": "123 456   7890   ",
        "expected": "1234567890"
      },
      {
        "description": "invalid when 9 digits",
        "phrase": "123456789",
        "expected": null
      },
      {
        "description": "invalid when 11 digits",
        "phrase": "21234567890",
        "expected": null
      },
      {
        "description": "valid when 11 digits and starting with 1",
        "phrase": "11234567890",
        "expected": "1234567890"
      },
      {
        "description": "invalid when 12 digits",
        "phrase": "321234567890",
        "expected": null
      },
      {
        "description": "invalid with letters",
        "phrase": "123-abc-7890",
        "expected": null
      },
      {
        "description": "invalid with punctuations",
        "phrase": "123-@:!-7890",
        "expected": null
      },
      {
        "description": "invalid with right number of digits but letters mixed in",
        "phrase": "1a2b3c4d5e6f7g8h9i0j",
        "expected": null
      }
    ]
  }
}

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
trackler-2.0.8.16 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.15 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.14 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.13 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.12 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.11 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.10 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.9 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.8 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.7 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.6 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.5 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.4 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.3 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.2 common/exercises/phone-number/canonical-data.json
trackler-2.0.8.1 common/exercises/phone-number/canonical-data.json
trackler-2.0.7.0 common/exercises/phone-number/canonical-data.json
trackler-2.0.6.44 common/exercises/phone-number/canonical-data.json
trackler-2.0.6.43 common/exercises/phone-number/canonical-data.json
trackler-2.0.6.42 common/exercises/phone-number/canonical-data.json