Sha256: 2c5025904d0e116a227e094c8ec80ac08f667d09004be01d0a2f9f554b323cd1
Contents?: true
Size: 1.43 KB
Versions: 396
Compression:
Stored size: 1.43 KB
Contents
local diamond = require 'diamond' describe('diamond', function() it('should generate the diamond for A', function() assert.are.equal('A\n', diamond('A')) end) it('should generate the diamond for B', function() local expected = ' A \n' .. 'B B\n' .. ' A \n' assert.are.equal(expected, diamond('B')) end) it('should generate the diamond for C', function() local expected = ' A \n' .. ' B B \n' .. 'C C\n' .. ' B B \n' .. ' A \n' assert.are.equal(expected, diamond('C')) end) it('should generate the diamond for E', function() local expected = ' A \n' .. ' B B \n' .. ' C C \n' .. ' D D \n' .. 'E E\n' .. ' D D \n' .. ' C C \n' .. ' B B \n' .. ' A \n' assert.are.equal(expected, diamond('E')) end) it('should generate the diamond for H', function() local expected = ' A \n' .. ' B B \n' .. ' C C \n' .. ' D D \n' .. ' E E \n' .. ' F F \n' .. ' G G \n' .. 'H H\n' .. ' G G \n' .. ' F F \n' .. ' E E \n' .. ' D D \n' .. ' C C \n' .. ' B B \n' .. ' A \n' assert.are.equal(expected, diamond('H')) end) end)
Version data entries
396 entries across 396 versions & 1 rubygems