PageRenderTime 249ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/Formula/casperjs.rb

https://gitlab.com/jcsilkey/homebrew-core
Ruby | 36 lines | 30 code | 5 blank | 1 comment | 1 complexity | d05863a93e632637bca23a8d9abfbca3 MD5 | raw file
  1. class Casperjs < Formula
  2. desc "Navigation scripting and testing tool for PhantomJS"
  3. homepage "http://www.casperjs.org/"
  4. url "https://github.com/casperjs/casperjs/archive/1.1.3.tar.gz"
  5. sha256 "3e9c385a2e3124a44728b24d3b4cad05a48e2b3827e9350bdfe11c9a6d4a4298"
  6. head "https://github.com/casperjs/casperjs.git"
  7. bottle do
  8. cellar :any_skip_relocation
  9. sha256 "b71c26fc5d2d6da94cc95554defbe5db1c6e0213d64ec09fea99755ffd529df4" => :el_capitan
  10. sha256 "3ca3351236ac827a5cd745087e7763dbd7445e05e4ce05aa11c5bbc7d62d75a6" => :yosemite
  11. sha256 "082b442968052c819463dacd01b99954f9e2e9e0a5d318c9b7a69e9f31e660f2" => :mavericks
  12. end
  13. # For embedded Phantomjs
  14. depends_on :macos => :snow_leopard
  15. depends_on "phantomjs"
  16. def install
  17. libexec.install Dir["*"]
  18. bin.install_symlink libexec/"bin/casperjs"
  19. end
  20. test do
  21. (testpath/"fetch.js").write <<-EOS.undent
  22. var casper = require("casper").create();
  23. casper.start("https://duckduckgo.com/about", function() {
  24. this.download("https://duckduckgo.com/assets/dax-alt.svg", "dax-alt.svg");
  25. });
  26. casper.run();
  27. EOS
  28. system bin/"casperjs", testpath/"fetch.js"
  29. assert File.exist?("dax-alt.svg")
  30. end
  31. end