diff --git a/CHANGELOG.md b/CHANGELOG.md index 06d8f26..6553c3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ * All implementations are now based on `Clipboard::Implementation` * Move implementation detection to `utils.rb` +### Other +* Add more specs and run them on GitHub Actions CI + ## 1.4.1 * Always use plaintext mimetype for wl-clipboard * Do not include newline when pasting from wl-clipboard diff --git a/spec/clipboard_windows_spec.rb b/spec/clipboard_windows_spec.rb new file mode 100644 index 0000000..5c2720a --- /dev/null +++ b/spec/clipboard_windows_spec.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative "spec_helper" + +require "rbconfig" + +if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ + require 'clipboard/windows' + + describe "Clipboard::Windows" do + before :all do + Clipboard.implementation = Clipboard::Windows + end + + it "can copy & paste" do + expect( Clipboard.copy('example') ).to eq true + expect( Clipboard.paste ).to eq 'example'.encode("UTF16-LE") + end + + it "can clear" do + expect( Clipboard.copy('example') ).to eq true + expect( Clipboard.paste ).to eq 'example'.encode("UTF16-LE") + Clipboard.clear + expect( Clipboard.paste ).to eq '' + end + end +end