2012-10-25 03:42:24 +04:00
|
|
|
describe "Pasteboard", ->
|
|
|
|
describe "write(text, metadata) and read()", ->
|
|
|
|
it "writes and reads text to/from the native pasteboard", ->
|
2013-01-11 03:33:30 +04:00
|
|
|
expect(pasteboard.read()).toEqual ['initial pasteboard content']
|
2012-10-25 03:42:24 +04:00
|
|
|
pasteboard.write('next')
|
2013-01-11 03:33:30 +04:00
|
|
|
expect(pasteboard.read()[0]).toBe 'next'
|
2012-10-25 03:42:24 +04:00
|
|
|
|
|
|
|
it "returns metadata if the item on the native pasteboard matches the last written item", ->
|
|
|
|
pasteboard.write('next', {meta: 'data'})
|
|
|
|
expect(pasteboard.read()).toEqual ['next', {meta: 'data'}]
|