Created
February 16, 2014 16:14
-
-
Save jamiebuilds/9036648 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.0.rc.4) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
/** | |
* Micro Bootcamp | |
*/ | |
$p: 0; $f: 0; | |
// Describe: | |
@mixin describe($t) { | |
$p: 0 !global; $f: 0 !global; | |
#{$t} { | |
@content; | |
@if $p > 0 { Passed: #{$p} } | |
@if $f > 0 { Failed: #{$f} } | |
} | |
} | |
// Expect: | |
@mixin expect($e) { | |
$a: nth($e, 1); $b: nth($e, 4); | |
$t: nth($e, 2); $m: nth($e, 3); | |
Expected: $e; | |
$r: call($m, $a, $b); | |
@if $t == "not-to" { $r: not $r } | |
@if $r { $p: $p + 1 !global } | |
@else { $f: $f + 1 !global } | |
} | |
// Matchers: | |
@function be($a, $b) { @return $a == $b } | |
@function be-greater-than($a, $b) { @return $a > $b } | |
@function be-less-than($a, $b) { @return $a < $b } | |
// Test Suite: | |
@include describe("Some tests") { | |
@include expect( 1 to be 1 ); | |
@include expect( 1 to be-greater-than 0 ); | |
@include expect( 1 to be-less-than 2 ); | |
} | |
@include describe("Some more tests") { | |
@include expect( 1 to be 1 ); | |
@include expect( 1 not-to be-greater-than 4 ); | |
@include expect( 1 to be-less-than 2 ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Micro Bootcamp | |
*/ | |
Some tests { | |
Expected: 1 to be 1; | |
Expected: 1 to be-greater-than 0; | |
Expected: 1 to be-less-than 2; | |
Passed: 3; | |
} | |
Some more tests { | |
Expected: 1 to be 1; | |
Expected: 1 not-to be-greater-than 4; | |
Expected: 1 to be-less-than 2; | |
Passed: 3; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment