Sha256: 07e40da64b6724085beb3765e1817384c1e7ee4673579a973e69a152293b6e95

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

RSpec.describe PhNoToWord do
  it 'has a version number' do
    expect(PhNoToWord::VERSION).not_to be nil
  end

  it `convert the given 10 digit phone number (2282668687) to words
      and return an array and expected result` do
    result = PhNoToWord.convert '2282668687'

    expect(result.is_a?(Array)).to be true
    expect(result).to include('act, amounts', 'catamounts', 'acta, oot, mus')
    expect(result.size).to eq(53)
  end

  it `convert the given 10 digit phone number (6686787825) to words
      and return an array and expected result` do
    result = PhNoToWord.convert '6686787825'

    expect(result.is_a?(Array)).to be true
    expect(result).to include('not, ort, suck', 'motortruck', 'motor, truck')
    expect(result.size).to eq(44)
  end

  it `convert the given 10 digit phone number (8325783555) to words
      and return an empty array` do
    result = PhNoToWord.convert '8325783555'

    expect(result).to be_empty
    expect(result.is_a?(Array)).to be true
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ph_no_to_word-2.1.0 spec/ph_no_to_word_spec.rb