<commit_before>
describe "steroids", ->

  it "should exists", ->
    expect( typeof steroids ).toBeDefined()


describe "steroids.Animation", ->

  it "should be defined", ->
    expect( steroids.Animation ).toBeDefined()

  it "should perform", ->
    animationPerformed = false

    animation = new steroids.Animation()
    animation.perform {},
      onSuccess: -> animationPerformed = true

    waitsFor -> animationPerformed

    runs ->
      expect( animationPerformed ).toBeTruthy()


  # TODO: bug in native
  xit "should fail to perform twice", ->

    performFailed = false

    animation = new steroids.Animation()
    animation.perform()

    animation2 = new steroids.Animation()
    animation2.perform {},
      onFailure: ->
        performFailed = true

    waitsFor ->
      performFailed

    runs ->
      expect( performFailed ).toBeTruthy()

describe "steroids.device", ->

  it "should be defined", ->
    expect( steroids.device ).toBeDefined()

  describe "ping", ->

    it "should pong", ->

      ponged = false

      steroids.device.ping {},
        onSuccess: -> ponged = true

      waitsFor -> ponged

      runs ->
        expect( ponged ).toBeTruthy()


  describe "torch", ->

    it "should toggle", ->
      toggled = false

      steroids.device.torch.toggle {},
        onSuccess: -> toggled = true

      waitsFor -> toggled

      runs ->
        expect( toggled ).toBeTruthy()


describe "steroids.layers", ->

  it "should be defined", ->
    expect( steroids.layers ).toBeDefined()

  it "should open a new layer", ->
    googleLayer = new steroids.views.WebView("http://google.com")
    pushed = false

    steroids.layers.push {
      view: googleLayer
    }, {
      onSuccess: -> pushed = true
    }

    waitsFor -> pushed

    runs ->
      expect( pushed ).toBeTruthy()
      setTimeout ->
        steroids.layers.pop()
      , 1000


describe "steroids.modal", ->
<commit_msg>torch turn on and off specs<commit_after>
describe "steroids", ->

  it "should exists", ->
    expect( typeof steroids ).toBeDefined()


describe "steroids.Animation", ->

  it "should be defined", ->
    expect( steroids.Animation ).toBeDefined()

  it "should perform", ->
    animationPerformed = false

    animation = new steroids.Animation()
    animation.perform {},
      onSuccess: -> animationPerformed = true

    waitsFor -> animationPerformed

    runs ->
      expect( animationPerformed ).toBeTruthy()


  # TODO: bug in native
  xit "should fail to perform twice", ->

    performFailed = false

    animation = new steroids.Animation()
    animation.perform()

    animation2 = new steroids.Animation()
    animation2.perform {},
      onFailure: ->
        performFailed = true

    waitsFor ->
      performFailed

    runs ->
      expect( performFailed ).toBeTruthy()

describe "steroids.device", ->

  it "should be defined", ->
    expect( steroids.device ).toBeDefined()

  describe "ping", ->

    it "should pong", ->

      ponged = false

      steroids.device.ping {},
        onSuccess: -> ponged = true

      waitsFor -> ponged

      runs ->
        expect( ponged ).toBeTruthy()


  describe "torch", ->

    it "should toggle", ->
      toggled = false

      steroids.device.torch.toggle {},
        onSuccess: -> toggled = true

      waitsFor -> toggled

      runs ->
        expect( toggled ).toBeTruthy()

    it "should turn on", ->
      turnedOn = false

      steroids.device.torch.turnOn {},
        onSuccess: -> turnedOn = true

      waitsFor -> turnedOn

      runs ->
        expect( turnedOn ).toBeTruthy()

    it "should turn off", ->
      turnedOff = false

      steroids.device.torch.turnOff {},
        onSuccess: -> turnedOff = true

      waitsFor -> turnedOff

      runs ->
        expect( turnedOff ).toBeTruthy()


describe "steroids.layers", ->

  it "should be defined", ->
    expect( steroids.layers ).toBeDefined()

  it "should open a new layer", ->
    googleLayer = new steroids.views.WebView("http://google.com")
    pushed = false

    steroids.layers.push {
      view: googleLayer
    }, {
      onSuccess: -> pushed = true
    }

    waitsFor -> pushed

    runs ->
      expect( pushed ).toBeTruthy()
      setTimeout ->
        steroids.layers.pop()
      , 1000


describe "steroids.modal", ->

{'fraction_non_alphanumeric': 0.12401300510915002, 'fraction_numerical': 0.002786809103576405, 'mean_word_length': 2.2334834834834836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2956168', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1238, 'n_words': 329}