Sha256: fd725a7ea39a76311ddfc34181203bf18eca0810d3f82923b1fb97f7723c8105
Contents?: true
Size: 672 Bytes
Versions: 330
Compression:
Stored size: 672 Bytes
Contents
local luhn = require('luhn') describe('luhn', function() it('should indicate that single digits are invalid', function() assert.equal(false, luhn.valid('1')) assert.equal(false, luhn.valid('0')) end) it('should check a valid Canadian SIN', function() assert.equal(true, luhn.valid('046 454 286')) end) it('should check an invalid Canadian SIN', function() assert.equal(false, luhn.valid('046 454 287')) end) it('should check an invalid credit card', function() assert.equal(false, luhn.valid('8273 1232 7352 0569')) end) it('should not allow non-digits', function() assert.equal(false, luhn.valid('a46 454 286')) end) end)
Version data entries
330 entries across 330 versions & 1 rubygems