   it "performs exponentiation", ->
     @handle.press_buttons("2 ^ 2 =")
     expect(@handle.output_content()).toEqual("4")
-    
+
   it "displays what is entered", ->
     @handle.press_buttons("8")
     expect(@handle.output_content()).toEqual("8")


  output: ->
    @element.find("figure.calculator-display")
    
  output_content: ->
    @output().text()


  it "divides", ->
    @handle.press_buttons("1 0 / 2 =")
    expect(@handle.output_content()).toEqual("5")

  it "does pi", ->
    @handle.press_buttons("pi =")
    expect(@handle.output_content()).toMatch /3.14/

  it "handles order of operations correctly", ->
    @handle.press_buttons("1 + 1 - 2 * 2 =")
    expect(@handle.output_content()).toMatch /-2/

  describe "decimal entry", ->
    it "displays 0 at first", ->
      expect(@handle.output_content()).toMatch /0/

    it "displays 0. when user presses a period", ->
      @handle.press_buttons(".")
      expect(@handle.output_content()).toEqual "0."

    it "displays 0.1 when user continues to add numbers", ->
      @handle.press_buttons(". 1")
      expect(@handle.output_content()).toEqual "0.1"

describe "Calculator error handling", ->
  beforeEach ->
