Sha256: 9bfe6278b9ae84c09979539097f99ccc7d88d0f416342b6152f7bba22efb06b8

Contents?: true

Size: 1.1 KB

Versions: 396

Compression:

Stored size: 1.1 KB

Contents

Hexadecimal = require('./hexadecimal')

describe "Hexadecimal", ->

  it "hex 1 is decimal 1", ->
    hex = new Hexadecimal("1")
    expect(hex.toDecimal()).toEqual(1)

  xit "hex c is decimal 12", ->
    hex = new Hexadecimal("c")
    expect(hex.toDecimal()).toEqual(12)

  xit "hex 10 is decimal 16", ->
    hex = new Hexadecimal("10")
    expect(hex.toDecimal()).toEqual(16)

  xit "hex af is decimal 175", ->
    hex = new Hexadecimal("af")
    expect(hex.toDecimal()).toEqual(175)

  xit "hex 100 is decimal 256", ->
    hex = new Hexadecimal("100")
    expect(hex.toDecimal()).toEqual(256)

  xit "hex 19ace is decimal 105166", ->
    hex = new Hexadecimal("19ace")
    expect(hex.toDecimal()).toEqual(105166)

  xit "invalid hex is decimal 0", ->
    hex = new Hexadecimal("carrot")
    expect(hex.toDecimal()).toEqual(0)

  xit "black", ->
    hex = new Hexadecimal("000000")
    expect(hex.toDecimal()).toEqual(0)

  xit "white", ->
    hex = new Hexadecimal("ffffff")
    expect(hex.toDecimal()).toEqual(16777215)

  xit "yellow", ->
    hex = new Hexadecimal("ffff00")
    expect(hex.toDecimal()).toEqual(16776960)

Version data entries

396 entries across 396 versions & 1 rubygems

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