diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e2304a3..c37f66a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,9 @@ jobs: ruby-version: ${{matrix.ruby}} bundler-cache: true - name: Run tests - run: bundle exec rake + uses: coactions/setup-xvfb@v1 + with: + run: bundle exec rake test-windows: name: Ruby ${{ matrix.ruby }} (windows-latest) diff --git a/spec/clipboard_java_spec.rb b/spec/clipboard_java_spec.rb new file mode 100644 index 0000000..f44693b --- /dev/null +++ b/spec/clipboard_java_spec.rb @@ -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