Skip to content

Instantly share code, notes, and snippets.

@andreastt
Created March 10, 2011 11:50
Show Gist options
  • Save andreastt/863985 to your computer and use it in GitHub Desktop.
Save andreastt/863985 to your computer and use it in GitHub Desktop.
require 'operawatir/helper'
require 'clipboard'
describe 'Opera' do
describe 'Clipboard' do
before :each do
browser.url = 'http://t/test.html'
window.p(:id, 'test').double_click
end
platform_dependent_on :windows, :linux do
it 'copies marked text to clipboard on Windows and Linux' do
browser.keys.send [:Control, 'C']
Clipboard.paste.should include 'foobar'
end
end
platform_dependent_on :macosx do
it 'copies marked text to clipboard on OS X' do
browser.keys.send [:Command, 'C']
Clipboard.paste.should include 'foobar'
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment