Skip to content

Commit

Permalink
Add spec for Clipboard::Java
Browse files Browse the repository at this point in the history
  • Loading branch information
janlelis committed Apr 5, 2024
1 parent 45a7ff7 commit 136aa06
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- name: Configure X11
uses: coactions/setup-xvfb@v1
- name: Run tests
run: bundle exec rake

Expand Down
25 changes: 25 additions & 0 deletions spec/clipboard_java_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

require_relative "spec_helper"

if RUBY_ENGINE === "jruby"
require 'clipboard/java'

describe "Clipboard::Java" do
before :all do
Clipboard.implementation = Clipboard::Java
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 136aa06

Please sign in to comment.