libsass: use test DSL

This commit is contained in:
Jack Nagel committed 2013-02-01 23:38:53 -06:00
1 parent 37748c461a
commit 4ddbf4ef6e
1 file changed
+18 -20
+18 -20
View File
@@ -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