true 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +16 -3
- data/sass/true/_assert.scss +12 -4
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,11 +1,24 @@
|
|
1
1
|
True
|
2
2
|
====
|
3
3
|
|
4
|
-
|
4
|
+
*Verb*
|
5
|
+
|
6
|
+
1. To make true; shape, adjust, place, etc., exactly or accurately:
|
7
|
+
*True the wheels of a bicycle after striking a pothole.*
|
8
|
+
2. To make even, symmetrical, level, etc. (often followed by *up*):
|
9
|
+
*True up the sides of a door.*
|
10
|
+
3. A testing framework for Sass/Compass libraries:
|
11
|
+
*True your Sass before you deploy.*
|
5
12
|
|
6
13
|
At this point
|
7
14
|
True can only test values,
|
8
15
|
not property/value output.
|
16
|
+
I'd like that to change in the future,
|
17
|
+
but it will require ruby code to achieve.
|
18
|
+
In the meantime,
|
19
|
+
you use True for logical unit tests,
|
20
|
+
and use version-control for integration testing
|
21
|
+
by comparing changes in output files.
|
9
22
|
|
10
23
|
Install
|
11
24
|
-------
|
@@ -36,12 +49,12 @@ in your scss:
|
|
36
49
|
|
37
50
|
// Assert something, with a message to post if the assertion fails.
|
38
51
|
@include assert-equal($test-1, 15,
|
39
|
-
'Simple multiplication
|
52
|
+
'Simple multiplication of `3*5` should return `15`.');
|
40
53
|
|
41
54
|
// You can assert-equal, assert-unequal, assert-true, or assert-false.
|
42
55
|
// A test can include as many assertions as you need.
|
43
56
|
@include assert-true($test-2,
|
44
|
-
'
|
57
|
+
'`something` should return `true` in the `if()` function.');
|
45
58
|
}
|
46
59
|
|
47
60
|
}
|
data/sass/true/_assert.scss
CHANGED
@@ -3,16 +3,20 @@
|
|
3
3
|
|
4
4
|
@mixin assert-true(
|
5
5
|
$assert,
|
6
|
-
$fail-message:
|
6
|
+
$fail-message: null
|
7
7
|
) {
|
8
|
+
$default-message: ' (#{$assert} is not true)';
|
9
|
+
$fail-message: $fail-message + $default-message;
|
8
10
|
@if $assert { @include pass; }
|
9
11
|
@else { @include fail($fail-message); }
|
10
12
|
}
|
11
13
|
|
12
14
|
@mixin assert-false(
|
13
15
|
$assert,
|
14
|
-
$fail-message:
|
16
|
+
$fail-message: null
|
15
17
|
) {
|
18
|
+
$default-message: ' (#{$assert} is not false)';
|
19
|
+
$fail-message: $fail-message + $default-message;
|
16
20
|
@if not $assert { @include pass; }
|
17
21
|
@else { @include fail($fail-message); }
|
18
22
|
}
|
@@ -20,8 +24,10 @@
|
|
20
24
|
@mixin assert-equal(
|
21
25
|
$assert,
|
22
26
|
$expected,
|
23
|
-
$fail-message:
|
27
|
+
$fail-message: null
|
24
28
|
) {
|
29
|
+
$default-message: ' (#{$assert} != #{$expected})';
|
30
|
+
$fail-message: $fail-message + $default-message;
|
25
31
|
@if $assert == $expected { @include pass; }
|
26
32
|
@else { @include fail($fail-message); }
|
27
33
|
}
|
@@ -29,8 +35,10 @@
|
|
29
35
|
@mixin assert-unequal(
|
30
36
|
$assert,
|
31
37
|
$expected,
|
32
|
-
$fail-message:
|
38
|
+
$fail-message: null
|
33
39
|
) {
|
40
|
+
$default-message: ' (#{$assert} == #{$expected})';
|
41
|
+
$fail-message: $fail-message + $default-message;
|
34
42
|
@if $assert != $expected { @include pass; }
|
35
43
|
@else { @include fail($fail-message); }
|
36
44
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: "true"
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eric Meyer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-06-
|
18
|
+
date: 2013-06-10 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: compass
|