homebrew-core/Formula/xmlsh.rb
Mike Naberezny 00f5363bf7 xmlsh: add test
Closes Homebrew/homebrew#28202.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2014-04-06 11:50:13 -07:00

24 lines
617 B
Ruby

require 'formula'
class Xmlsh < Formula
homepage 'http://www.xmlsh.org'
url 'https://downloads.sourceforge.net/project/xmlsh/xmlsh/1.2.4/xmlsh_1_2_4.zip'
sha1 'ef11e6fa3d72d99b78331a4ab58a22b1ad08b4ef'
def install
rm_rf %w[win32 cygwin]
libexec.install Dir["*"]
chmod 0755, "#{libexec}/unix/xmlsh"
(bin/"xmlsh").write <<-EOS.undent
#!/bin/bash
export XMLSH=#{libexec}
exec #{libexec}/unix/xmlsh "$@"
EOS
end
test do
out = `#{bin}/xmlsh -c 'x=<[<foo bar="baz" />]> && echo <[$x/@bar]>'`
assert_equal "baz\n", out
assert_equal 0, $?.exitstatus
end
end