Sha256: 68acc34398e6efb969685f096b715cb579eba83f2d3106035879a289a8b5fa37

Contents?: true

Size: 611 Bytes

Versions: 4

Compression:

Stored size: 611 Bytes

Contents

describe "Format", ->
  beforeEach ->
    @f = Format
  
  it "can format speed", ->
    expect( @f.speed(2048) ).toEqual("2.00 KB/s")
    expect( @f.speed(2097152) ).toEqual("2.00 MB/s")
  
  it "can format size", ->
    expect( @f.size(2048) ).toEqual("2.00 KB")
    expect( @f.size(2097152) ).toEqual("2.00 MB")
  
  it "can format time duration", ->
    expect( @f.delay(100) ).toEqual("100.00 ms")
    expect( @f.delay(1000 * 2) ).toEqual("2.00 s")
    expect( @f.delay(1000 * 60 * 2) ).toEqual("2.00 m")
    expect( @f.delay(1000 * 60 * 60 * 2) ).toEqual("2.00 h")

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rrd-grapher-1.0.3 spec/javascripts/source/format_spec.coffee
rrd-grapher-1.0.2 spec/javascripts/source/format_spec.coffee
rrd-grapher-1.0.1 spec/javascripts/source/format_spec.coffee
rrd-grapher-1.0.0 spec/javascripts/source/format_spec.coffee