Move custom invisible glyph spec to editor spec

This commit is contained in:
Nathan Sobo
2012-12-12 15:55:12 -08:00
parent c19c9e0d1f
commit c9b7618ea0
2 changed files with 17 additions and 27 deletions

View File

@@ -1579,6 +1579,23 @@ describe "Editor", ->
editor.setText "var"
expect(editor.find('.line').html()).toBe '<span class="source js"><span class="storage modifier js">var</span></span><span class="invisible">¬</span>'
it "allows invisible glyphs to be customized via config.editor.invisibles", ->
rootView.height(200)
rootView.attachToDom()
rightEditor = rootView.getActiveEditor()
rightEditor.setText(" \t ")
leftEditor = rightEditor.splitLeft()
config.editor.showInvisibles = true
config.editor.invisibles =
eol: ";"
space: "_"
tab: "tab"
config.update()
expect(rightEditor.find(".line:first").text()).toBe "_tab _;"
expect(leftEditor.find(".line:first").text()).toBe "_tab _;"
describe "gutter rendering", ->
beforeEach ->
editor.attachToDom(heightInLines: 5.5)

View File

@@ -712,30 +712,3 @@ describe "RootView", ->
lowerRightEditor = rightEditor.splitDown()
expect(lowerRightEditor.find(".line:first").text()).toBe " "
describe 'setInvisibles', ->
it 'updates the display of all edit sessions with the new map', ->
rootView.height(200)
rootView.attachToDom()
rightEditor = rootView.getActiveEditor()
rightEditor.setText(" \t ")
leftEditor = rightEditor.splitLeft()
rootView.setInvisibles
eol: ";"
space: "_"
tab: "tab"
rootView.trigger "window:toggle-invisibles"
expect(rightEditor.find(".line:first").text()).toBe "_tab _;"
expect(leftEditor.find(".line:first").text()).toBe "_tab _;"
describe 'getInvisibles', ->
it 'contains an eol key with a value', ->
expect(rootView.getInvisibles().eol).toBe "¬"
it 'contains a space key with a value', ->
expect(rootView.getInvisibles().space).toBe ""
it 'contains a tab key with a value', ->
expect(rootView.getInvisibles().tab).toBe ""