This commit is contained in:
Nathan Sobo
2012-01-13 19:18:04 -08:00
parent 7546ddc8cc
commit 1809ba4ef1
3 changed files with 6 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ describe 'Buffer', ->
buffer = new Buffer null
expect(buffer.getText()).toBe ""
describe "save", ->
describe ".save()", ->
describe "when the buffer has a url", ->
filePath = null
@@ -45,7 +45,7 @@ describe 'Buffer', ->
buffer = new Buffer
expect(-> buffer.save()).toThrow()
describe "getMode", ->
describe ".getMode()", ->
describe "when given a url", ->
it "sets 'mode' based on the file extension", ->
buffer = new Buffer 'something.js'
@@ -58,3 +58,4 @@ describe 'Buffer', ->
it "sets 'mode' to text mode", ->
buffer = new Buffer null
expect(buffer.getMode().name).toBe 'text'

View File

@@ -24,7 +24,7 @@ describe "Editor", ->
expect(editor.buffer).toBeDefined()
describe '.set/getCursor', ->
it "moves the cursor", ->
it "gets the cursor location / moves the cursor location", ->
editor.buffer.setText("012345")
expect(editor.getCursor()).toEqual {column: 6, row: 0}
editor.setCursor(column: 2, row: 0)

View File

@@ -64,14 +64,14 @@ describe "VimMode", ->
editor.setCursor(column: 1, row: 1)
describe "the h keybinding", ->
it "move the cursor left", ->
it "moves the cursor left, but not to the previous line", ->
editor.trigger keydownEvent('h')
expect(editor.getCursor()).toEqual(column: 0, row: 1)
editor.trigger keydownEvent('h')
expect(editor.getCursor()).toEqual(column: 0, row: 1)
describe "the j keybinding", ->
it "move the cursor up", ->
it "moves the cursor up, but not to the beginning of the first line", ->
editor.trigger keydownEvent('j')
expect(editor.getCursor()).toEqual(column: 1, row: 0)
editor.trigger keydownEvent('j')