2012-05-31 22:05:56 +00:00
|
|
|
class Casperjs < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Navigation scripting and testing tool for PhantomJS"
|
2015-04-15 17:40:28 +00:00
|
|
|
homepage "http://www.casperjs.org/"
|
2016-07-23 10:19:49 +00:00
|
|
|
url "https://github.com/casperjs/casperjs/archive/1.1.3.tar.gz"
|
|
|
|
sha256 "3e9c385a2e3124a44728b24d3b4cad05a48e2b3827e9350bdfe11c9a6d4a4298"
|
2016-06-21 08:57:31 +00:00
|
|
|
head "https://github.com/casperjs/casperjs.git"
|
2012-05-31 22:05:56 +00:00
|
|
|
|
2015-04-17 07:46:10 +00:00
|
|
|
bottle do
|
2015-09-23 16:30:10 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-07-23 10:36:31 +00:00
|
|
|
sha256 "b71c26fc5d2d6da94cc95554defbe5db1c6e0213d64ec09fea99755ffd529df4" => :el_capitan
|
|
|
|
sha256 "3ca3351236ac827a5cd745087e7763dbd7445e05e4ce05aa11c5bbc7d62d75a6" => :yosemite
|
|
|
|
sha256 "082b442968052c819463dacd01b99954f9e2e9e0a5d318c9b7a69e9f31e660f2" => :mavericks
|
2015-04-17 07:46:10 +00:00
|
|
|
end
|
|
|
|
|
2015-04-15 17:40:28 +00:00
|
|
|
# For embedded Phantomjs
|
|
|
|
depends_on :macos => :snow_leopard
|
2016-06-21 08:57:31 +00:00
|
|
|
depends_on "phantomjs"
|
2012-05-31 22:05:56 +00:00
|
|
|
|
|
|
|
def install
|
2015-04-15 17:40:28 +00:00
|
|
|
libexec.install Dir["*"]
|
2016-06-21 08:57:31 +00:00
|
|
|
bin.install_symlink libexec/"bin/casperjs"
|
2015-04-15 17:40:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-08-22 19:44:33 +00:00
|
|
|
(testpath/"fetch.js").write <<-EOS.undent
|
|
|
|
var casper = require("casper").create();
|
|
|
|
casper.start("https://duckduckgo.com/about", function() {
|
|
|
|
this.download("https://duckduckgo.com/assets/dax-alt.svg", "dax-alt.svg");
|
|
|
|
});
|
|
|
|
casper.run();
|
|
|
|
EOS
|
|
|
|
|
|
|
|
system bin/"casperjs", testpath/"fetch.js"
|
|
|
|
assert File.exist?("dax-alt.svg")
|
2012-05-31 22:05:56 +00:00
|
|
|
end
|
|
|
|
end
|