homebrew-core/Formula/crowdin.rb
Izaak Beekman 966fd89347
crowdin: add better tests
Closes #39282.

Signed-off-by: Izaak Beekman <zbeekman@gmail.com>
2019-04-25 11:35:28 -04:00

25 lines
874 B
Ruby

class Crowdin < Formula
desc "Command-line tool that allows to manage your resources with crowdin.com"
homepage "https://support.crowdin.com/cli-tool/"
url "https://downloads.crowdin.com/cli/v2/crowdin-cli-2.0.29.zip"
sha256 "5fa69facda79a5c9f70018c86de5467edd2fcaf0154da92d59d4f63003cc7af0"
bottle :unneeded
depends_on :java => "1.7+"
def install
libexec.install "crowdin-cli.jar"
bin.write_jar_script libexec/"crowdin-cli.jar", "crowdin"
end
test do
generate_output = shell_output("#{bin}/crowdin generate").chomp
assert_predicate testpath/"crowdin.yml", :exist?
assert_match /^Generates Crowdin CLI configuration skeleton .*crowdin\.yml\'- OK$/, generate_output
lint_output = shell_output("#{bin}/crowdin lint").split("\n")
lint_output.each do |line|
assert_match /^Project [^ ]+ is empty$/, line
end
end
end