2014-02-04 01:12:33 +04:00
|
|
|
describe "Clipboard", ->
|
2012-10-25 03:42:24 +04:00
|
|
|
describe "write(text, metadata) and read()", ->
|
2014-02-04 01:12:33 +04:00
|
|
|
it "writes and reads text to/from the native clipboard", ->
|
2014-02-04 01:20:24 +04:00
|
|
|
expect(atom.clipboard.read()).toBe 'initial clipboard content'
|
2014-02-04 01:10:10 +04:00
|
|
|
atom.clipboard.write('next')
|
2014-02-04 01:20:24 +04:00
|
|
|
expect(atom.clipboard.read()).toBe 'next'
|
2012-10-25 03:42:24 +04:00
|
|
|
|
2014-02-04 01:12:33 +04:00
|
|
|
it "returns metadata if the item on the native clipboard matches the last written item", ->
|
2014-02-04 01:10:10 +04:00
|
|
|
atom.clipboard.write('next', {meta: 'data'})
|
2014-02-04 01:20:24 +04:00
|
|
|
expect(atom.clipboard.read()).toBe 'next'
|
|
|
|
expect(atom.clipboard.readWithMetadata().text).toBe 'next'
|
|
|
|
expect(atom.clipboard.readWithMetadata().metadata).toEqual {meta: 'data'}
|