Skip to content

Commit

Permalink
Add spec for Clipboard::Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
janlelis committed Apr 5, 2024
1 parent 9702312 commit cd2a18d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/clipboard_linux_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

require_relative "spec_helper"

require "rbconfig"

if RbConfig::CONFIG['host_os'] =~ /linux|bsd/
require 'clipboard/linux'

describe "Clipboard::Linux" do
before :all do
Clipboard.implementation = Clipboard::Linux
end

it "can copy & paste" do
expect( Clipboard.copy('example') ).to eq true
expect( Clipboard.paste ).to eq 'example'
end

it "can clear" do
expect( Clipboard.copy('example') ).to eq true
expect( Clipboard.paste ).to eq 'example'
Clipboard.clear
expect( Clipboard.paste ).to eq ''
end
end
end

0 comments on commit cd2a18d

Please sign in to comment.