aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libsass.rb
diff options
context:
space:
mode:
authorJack Nagel2013-02-01 23:12:42 -0600
committerJack Nagel2013-02-01 23:38:53 -0600
commit4ddbf4ef6e32453edbc7c92d4bd60aea8c8bb978 (patch)
tree15ea1e1fbb14a34cd3716f74ca2342c38fbe3f81 /Library/Formula/libsass.rb
parent37748c461a63ac504d222389faf9860ade54ab08 (diff)
downloadhomebrew-4ddbf4ef6e32453edbc7c92d4bd60aea8c8bb978.tar.bz2
libsass: use test DSL
Diffstat (limited to 'Library/Formula/libsass.rb')
-rw-r--r--Library/Formula/libsass.rb38
1 files changed, 18 insertions, 20 deletions
diff --git a/Library/Formula/libsass.rb b/Library/Formula/libsass.rb
index 7095fc0d5..005101446 100644
--- a/Library/Formula/libsass.rb
+++ b/Library/Formula/libsass.rb
@@ -10,27 +10,25 @@ class Libsass < Formula
system "make install"
end
- def test
- mktemp do
- (Pathname.pwd/"test.c").write <<-EOS.undent
- #include <sass_interface.h>
- #include <string.h>
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <sass_interface.h>
+ #include <string.h>
- int main()
- {
- struct sass_context* sass_ctx = sass_new_context();
- sass_ctx->source_string = "a { color:blue; &:hover { color:red; } }";
- sass_ctx->options.output_style = SASS_STYLE_NESTED;
- sass_compile(sass_ctx);
- if(sass_ctx->error_status) {
- return 1;
- } else {
- return strcmp(sass_ctx->output_string, "a {\\n color: blue; }\\n a:hover {\\n color: red; }\\n") != 0;
- }
+ int main()
+ {
+ struct sass_context* sass_ctx = sass_new_context();
+ sass_ctx->source_string = "a { color:blue; &:hover { color:red; } }";
+ sass_ctx->options.output_style = SASS_STYLE_NESTED;
+ sass_compile(sass_ctx);
+ if(sass_ctx->error_status) {
+ return 1;
+ } else {
+ return strcmp(sass_ctx->output_string, "a {\\n color: blue; }\\n a:hover {\\n color: red; }\\n") != 0;
}
- EOS
- system ENV.cc, "-o", "test", "test.c", "-lsass"
- system "./test"
- end
+ }
+ EOS
+ system ENV.cc, "-o", "test", "test.c", "-lsass"
+ system "./test"
end
end