From 1184376f02673a752abbab13a9790867f01a7179 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Tue, 29 Nov 2016 22:23:28 +1100 Subject: [PATCH] clipper 0.4 Closes #7381. Signed-off-by: Tomasz Pajor --- Formula/clipper.rb | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Formula/clipper.rb b/Formula/clipper.rb index 9e8c000e0a..a2c8a95c88 100644 --- a/Formula/clipper.rb +++ b/Formula/clipper.rb @@ -1,8 +1,9 @@ +# encoding: UTF-8 class Clipper < Formula desc "Share macOS clipboard with tmux and other local and remote apps" homepage "https://wincent.com/products/clipper" - url "https://github.com/wincent/clipper/archive/0.3.tar.gz" - sha256 "ddadc32477744f39a0604255c68c159613809f549c3b28bedcedd23f3f93bcf0" + url "https://github.com/wincent/clipper/archive/0.4.tar.gz" + sha256 "f94d898f575a974ca9658102a876b6852b58354ca445503909aeedcb3cb9964b" bottle do cellar :any_skip_relocation @@ -48,4 +49,25 @@ class Clipper < Formula EOS end + + test do + TEST_DATA = "a simple string! to test clipper, with söme spéciål characters!! 🐎\n".freeze + + cmd = [opt_bin/"clipper", "-a", testpath/"clipper.sock", "-l", testpath/"clipper.log"].freeze + ohai cmd.join " " + + require "open3" + Open3.popen3({ "LANG" => "en_US.UTF-8" }, *cmd) do |_, _, _, clipper| + sleep 0.5 # Give it a moment to launch and create its socket. + begin + sock = UNIXSocket.new testpath/"clipper.sock" + assert_equal TEST_DATA.bytesize, sock.sendmsg(TEST_DATA) + sock.close + sleep 0.5 + assert_equal TEST_DATA, `LANG=en_US.UTF-8 pbpaste` + ensure + Process.kill "TERM", clipper.pid + end + end + end end