mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Buffer is empty when created with no url.
This commit is contained in:
@@ -7,3 +7,7 @@ describe 'Buffer', ->
|
||||
filePath = require.resolve 'fixtures/sample.txt'
|
||||
buffer = new Buffer filePath
|
||||
expect(buffer.getText()).toBe fs.read(filePath)
|
||||
|
||||
it "loads an empty buffer if no url is given", ->
|
||||
buffer = new Buffer null
|
||||
expect(buffer.getText()).toBe ""
|
||||
|
||||
@@ -7,7 +7,8 @@ class Buffer
|
||||
url: null
|
||||
|
||||
constructor: (@url) ->
|
||||
@aceDocument = new Document fs.read(@url)
|
||||
text = if @url then fs.read(@url) else ""
|
||||
@aceDocument = new Document text
|
||||
|
||||
getText: ->
|
||||
@aceDocument.getValue()
|
||||
|
||||
Reference in New Issue
Block a user