:lipstick

This commit is contained in:
Corey Johnson 2012-03-23 09:50:41 -07:00
parent 49be6986a0
commit ef9bb5a259

View File

@ -18,6 +18,14 @@ describe "Editor", ->
editor.setBuffer(buffer) editor.setBuffer(buffer)
editor.isFocused = true editor.isFocused = true
describe "construction", ->
it "assigns an empty buffer and correctly handles text input (regression coverage)", ->
editor = new Editor
expect(editor.buffer.path).toBeUndefined()
expect(editor.lines.find('.line').length).toBe 1
editor.insertText('x')
expect(editor.lines.find('.line').length).toBe 1
describe "text rendering", -> describe "text rendering", ->
it "creates a line element for each line in the buffer with the html-escaped text of the line", -> it "creates a line element for each line in the buffer with the html-escaped text of the line", ->
expect(editor.lines.find('.line').length).toEqual(buffer.numLines()) expect(editor.lines.find('.line').length).toEqual(buffer.numLines())
@ -936,14 +944,6 @@ describe "Editor", ->
expect(editor.isFocused).toBeFalsy() expect(editor.isFocused).toBeFalsy()
expect(editor).not.toHaveClass('focused') expect(editor).not.toHaveClass('focused')
describe "construction", ->
it "assigns an empty buffer and correctly handles text input (regression coverage)", ->
editor = new Editor
expect(editor.buffer.path).toBeUndefined()
expect(editor.lines.find('.line').length).toBe 1
editor.insertText('x')
expect(editor.lines.find('.line').length).toBe 1
describe ".setBuffer(buffer)", -> describe ".setBuffer(buffer)", ->
it "sets the cursor to the beginning of the file", -> it "sets the cursor to the beginning of the file", ->
expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0) expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)