1
exercism fetch lua acronym

acronym_spec.lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local acronym = require('acronym')

describe('acronym', function()
  it('should generate single-letter acronyms', function()
    assert.equal('L', acronym('Lua'))
  end)

  it('should generate multi-letter acronyms', function()
    assert.equal('LUA', acronym('Lua Ultimate Acronym'))
  end)

  it('should include lowercase words', function()
    assert.equal('ROR', acronym('Ruby on Rails'))
  end)

  it('should ignore punctuation', function()
    assert.equal('FIFO', acronym('First In, First Out'))
  end)

  it('should split words with internal capitalization', function()
    assert.equal('HTML', acronym('HyperText Markup Language'))
  end)

  it('should not split words that are all uppercase', function()
    assert.equal('PHP', acronym('PHP: Hypertext Processor'))
  end)
end)