-
-# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
-#
-# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
-# or `fdescribe`). Remove the `f` to unfocus the block.
-
 describe "RubyDebugger", ->
   [workspaceElement, activationPromise] = []
 


  describe "when the ruby-debugger:toggle event is triggered", ->
    it "hides and shows the modal panel", ->
      # Before the activation event the view is not on the DOM, and no panel
      # has been created
      expect(workspaceElement.querySelector('.ruby-debugger')).not.toExist()

      # This is an activation event, triggering it will cause the package to be
      # activated.
      atom.commands.dispatch workspaceElement, 'ruby-debugger:toggle'

      waitsForPromise ->

        expect(panel.isVisible()).toBe false

    it "hides and shows the view", ->
      jasmine.attachToDOM(workspaceElement)

      expect(workspaceElement.querySelector('.ruby-debugger')).not.toExist()

      atom.commands.dispatch workspaceElement, 'ruby-debugger:toggle'

      waitsForPromise ->
        activationPromise

      runs ->
        element = workspaceElement.querySelector('.ruby-debugger')
        expect(element).toBeVisible()
        atom.commands.dispatch workspaceElement, 'ruby-debugger:toggle'
