Sha256: 4b76d515b8f7d822cbcd41ab7bb6fa7af5c1724fa4eaaf70d855120608ef3bcf

Contents?: true

Size: 1.09 KB

Versions: 207

Compression:

Stored size: 1.09 KB

Contents

Luhn = require './luhn'

describe 'Luhn', ->

  it "check digit", ->
    luhn = new Luhn(34567)
    expect(luhn.checkDigit).toEqual(7)

  xit "check digit again", ->
    luhn = new Luhn(91370)
    expect(luhn.checkDigit).toEqual(0)

  xit "addends", ->
    luhn = new Luhn(12121)
    expect(luhn.addends).toEqual([1, 4, 1, 4, 1])

  xit "too large added", ->
    luhn = new Luhn(8631)
    expect(luhn.addends).toEqual([7, 6, 6, 1])

  xit "checksum", ->
    luhn = new Luhn(4913)
    expect(luhn.checksum).toEqual(22)

  xit "checksum again", ->
    luhn = new Luhn(201773)
    expect(luhn.checksum).toEqual(21)

  xit "invalid number", ->
    luhn = new Luhn(738)
    expect(luhn.valid).toEqual(false)

  xit "valid number", ->
    luhn = new Luhn(8739567)
    expect(luhn.valid).toEqual(true)

  xit "create valid number", ->
    number = Luhn.create(123)
    expect(number).toEqual(1230)

  xit "create other valid number", ->
    number = Luhn.create(873956)
    expect(number).toEqual(8739567)

  xit "create yet another valid number", ->
    number = Luhn.create(837263756)
    expect(number).toEqual(8372637564)

Version data entries

207 entries across 207 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.179 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.178 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.177 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.176 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.175 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.174 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.173 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.172 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.171 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.170 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.169 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.167 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.166 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.165 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.164 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.163 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.162 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.161 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee
trackler-2.2.1.160 tracks/coffeescript/exercises/luhn/luhn_test.spec.coffee