Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from felixmulder/topic/add-dotd-test
Browse files Browse the repository at this point in the history
Add dotd test
  • Loading branch information
felixmulder authored May 26, 2017
2 parents b22c7b2 + 371734d commit 3af7777
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions dotty.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Dotty < Formula
desc "Experimental Scala Compiler"
homepage "http://dotty.epfl.ch/"
url "https://github.com/lampepfl/homebrew-brew/releases/download/v0.1-M1/dotty-0.1.1-bin-SNAPSHOT.zip"
sha256 "d5091aea45679c28774bb2039847a36a7c1f2a1abbe4ae9f79bf669afbca0232"
url "https://github.com/lampepfl/homebrew-brew/releases/download/v0.1-M2/dotty-0.1.1-bin-SNAPSHOT.zip"
sha256 "03d40979cfd265aecbdd5f4d8bed091b2328bdf54230ce42fffd039d9ee18a86"
# mirror "https://www.scala-lang.org/files/archive/scala-2.12.2.tgz"

bottle :unneeded
Expand All @@ -15,6 +15,7 @@ def install
end

test do
# test dotc and dotr:
file = testpath/"Test.scala"
file.write <<-EOS.undent
object Test {
Expand All @@ -28,5 +29,16 @@ def main(args: Array[String]) = {
out = shell_output("#{bin}/dotr Test").strip

assert_equal "4", out

# test dotd:
Dir.mkdir "#{testpath}/site"
index_out = testpath/"site"/"index.md"
index_out.write <<-EOS.undent
Hello, world!
=============
EOS
shell_output("#{bin}/dotd -siteroot #{testpath}/site #{file}")
index_file = File.open("#{testpath}/site/_site/index.html", "rb").read
assert index_file.include? '<h1><a href="#hello-world" id="hello-world">Hello, world!</a></h1>'
end
end
4 changes: 2 additions & 2 deletions osx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
brew install lampepfl/brew/dotty
brew test dotty
brew install dotty.rb
brew test dotty.rb

0 comments on commit 3af7777

Please sign in to comment.