true 0.2.0.rc.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -12
- data/VERSION +1 -1
- data/lib/true.rb +3 -3
- data/sass/true/_assert.scss +15 -29
- data/sass/true/_messages.scss +2 -21
- data/sass/true/_modules.scss +7 -7
- data/sass/true/_utilities.scss +0 -13
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66a0f767a421a3ff94af9713fb2c1291503494f8
|
4
|
+
data.tar.gz: 6a4b3366382ebefe0e8b6580942f844b513358a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04275f2cef76283d41e844fa761290f1b5b8988d5e42b42fb89e4b88fd69eace8c96ed79336c12e6fa57bce5f02df71d32aabf2ebf1640fbe8307573773d23a4
|
7
|
+
data.tar.gz: bfe9aae3a9032e680ace7b0f16b08633c04bcc21c997b128ab7e0d41c963dd3de9d7825a0cd31a4deb24339cbd2351740d1080420221988e71abe39e3f801bb2
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
True Changelog
|
2
2
|
==============
|
3
3
|
|
4
|
-
0.2.0 (
|
5
|
-
|
4
|
+
0.2.0 (unreleased)
|
5
|
+
------------------
|
6
6
|
- Simplified reporting in both terminal and CSS.
|
7
7
|
- Remove `default-module-output`, `$default-test-output` and `$default-final-output`.
|
8
8
|
Replace them with `$true` settings map: `(output: css, summary: terminal css)`.
|
@@ -10,40 +10,32 @@ True Changelog
|
|
10
10
|
Assertions are always output to the terminal if they fail.
|
11
11
|
- Update to use Sass map variables.
|
12
12
|
- Add `report` function and `report` mixin, for reporting final results.
|
13
|
-
- Only register as a compass extension if compass is present.
|
14
|
-
|
15
|
-
- Adjust the output styles to work with Sass 3.4
|
16
|
-
and have more visual consistency.
|
17
|
-
|
13
|
+
- Only register as a compass extension if compass is present. Compass is
|
14
|
+
no longer an explicit dependency.
|
18
15
|
|
19
16
|
0.1.5 (6/10/13)
|
20
17
|
---------------
|
21
18
|
- Append actual results to custom failure messages.
|
22
19
|
|
23
|
-
|
24
20
|
0.1.4 (6/9/13)
|
25
21
|
--------------
|
26
22
|
- Null result is considered a failure.
|
27
23
|
- Allow output to be turned off for certain modules/tests/assertions.
|
28
24
|
|
29
|
-
|
30
25
|
0.1.3 (6/7/13)
|
31
26
|
--------------
|
32
27
|
- Nest assertions within `test() {}` named tests.
|
33
28
|
- Cleaner css output.
|
34
29
|
|
35
|
-
|
36
30
|
0.1.2 (6/7/13)
|
37
31
|
--------------
|
38
32
|
- Use nesting for modules with `test-module() {}`
|
39
33
|
- Added failure message argument to all assertions.
|
40
34
|
|
41
|
-
|
42
35
|
0.1.1 (6/6/13)
|
43
36
|
--------------
|
44
37
|
- Fix bug in `lib/true.rb` compass plugin registration.
|
45
38
|
|
46
|
-
|
47
39
|
0.1.0 (6/6/13)
|
48
40
|
--------------
|
49
41
|
- `assert-true()`, `assert-false()`, `assert-equal()`, and `assert-unequal()`.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.0
|
1
|
+
0.2.0
|
data/lib/true.rb
CHANGED
@@ -4,9 +4,9 @@ begin
|
|
4
4
|
Compass::Frameworks.register('true', :stylesheets_directory => true_stylesheets_path)
|
5
5
|
rescue LoadError
|
6
6
|
# compass not found, register on the Sass path via the environment.
|
7
|
-
if ENV.
|
8
|
-
ENV[
|
7
|
+
if ENV.has_key?("SASSPATH")
|
8
|
+
ENV["SASSPATH"] = ENV["SASSPATH"] + File::PATH_SEPARATOR + true_stylesheets_path
|
9
9
|
else
|
10
|
-
ENV[
|
10
|
+
ENV["SASSPATH"] = true_stylesheets_path
|
11
11
|
end
|
12
12
|
end
|
data/sass/true/_assert.scss
CHANGED
@@ -5,20 +5,20 @@
|
|
5
5
|
$assert,
|
6
6
|
$fail-message: ''
|
7
7
|
) {
|
8
|
-
$
|
9
|
-
$
|
8
|
+
$test: map-get($test-results, name);
|
9
|
+
$fail-message: '#{$test}: ' + $fail-message + ' (#{inspect($assert)} is not true)';
|
10
10
|
$result: if($assert, pass, fail);
|
11
|
-
@include report-assert($
|
11
|
+
@include report-assert($result, $fail-message);
|
12
12
|
}
|
13
13
|
|
14
14
|
@mixin assert-false(
|
15
15
|
$assert,
|
16
16
|
$fail-message: ''
|
17
17
|
) {
|
18
|
-
$
|
19
|
-
$
|
18
|
+
$test: map-get($test-results, name);
|
19
|
+
$fail-message: '#{$test}: ' + $fail-message + ' (#{inspect($assert)} is not false)';
|
20
20
|
$result: if(not $assert, pass, fail);
|
21
|
-
@include report-assert($
|
21
|
+
@include report-assert($result, $fail-message);
|
22
22
|
}
|
23
23
|
|
24
24
|
@mixin assert-equal(
|
@@ -26,11 +26,10 @@
|
|
26
26
|
$expected,
|
27
27
|
$fail-message: ''
|
28
28
|
) {
|
29
|
-
$
|
30
|
-
$
|
31
|
-
'Result: #{inspect($assert)}';
|
29
|
+
$test: map-get($test-results, name);
|
30
|
+
$fail-message: '#{$test}: ' + $fail-message + ' (Expected: #{inspect($expected)} != Result: #{inspect($assert)})';
|
32
31
|
$result: if($assert == $expected, pass, fail);
|
33
|
-
@include report-assert($
|
32
|
+
@include report-assert($result, $fail-message);
|
34
33
|
}
|
35
34
|
|
36
35
|
@mixin assert-unequal(
|
@@ -38,34 +37,21 @@
|
|
38
37
|
$expected,
|
39
38
|
$fail-message: ''
|
40
39
|
) {
|
41
|
-
$
|
42
|
-
$
|
43
|
-
'Result: #{inspect($assert)}';
|
40
|
+
$test: map-get($test-results, name);
|
41
|
+
$fail-message: '#{$test}: ' + $fail-message + ' (Expected: #{inspect($expected)} == Result: #{inspect($assert)})';
|
44
42
|
$result: if($assert != $expected, pass, fail);
|
45
|
-
|
46
|
-
@include report-assert($name, $result, $fail-message, $debug-message...);
|
43
|
+
@include report-assert($result, $fail-message);
|
47
44
|
}
|
48
45
|
|
49
46
|
// Pass / Fail
|
50
47
|
// -----------
|
51
48
|
|
52
49
|
@mixin report-assert(
|
53
|
-
$name,
|
54
50
|
$result,
|
55
|
-
$fail-message:
|
56
|
-
$debug...
|
51
|
+
$fail-message: ''
|
57
52
|
) {
|
58
|
-
@if $result == fail {
|
59
|
-
@
|
60
|
-
|
61
|
-
@each $item in $debug {
|
62
|
-
@debug $item;
|
63
|
-
}
|
64
|
-
|
65
|
-
@if $fail-message {
|
66
|
-
@warn $fail-message;
|
67
|
-
}
|
53
|
+
@if $result == fail and $fail-message {
|
54
|
+
@warn $fail-message;
|
68
55
|
}
|
69
|
-
|
70
56
|
$test-results: map-add($test-results, (run: 1, $result: 1)) !global;
|
71
57
|
}
|
data/sass/true/_messages.scss
CHANGED
@@ -1,34 +1,15 @@
|
|
1
1
|
// Messages
|
2
2
|
// ========
|
3
3
|
|
4
|
-
$-tnl: "\a";
|
5
|
-
|
6
|
-
@mixin spacer-comment() {
|
7
|
-
/*
|
8
|
-
*/
|
9
|
-
}
|
10
|
-
|
11
4
|
@mixin result-message(
|
12
5
|
$message,
|
13
6
|
$output
|
14
7
|
) {
|
15
|
-
$lines: str-split($message, $-tnl);
|
16
8
|
@if index($output, css) {
|
17
|
-
|
18
|
-
/* #{$line} */
|
19
|
-
}
|
9
|
+
/* #{$message} */
|
20
10
|
} @else if index($output, debug) or index($output, terminal) {
|
21
|
-
@
|
22
|
-
@debug $line;
|
23
|
-
}
|
11
|
+
@debug $message;
|
24
12
|
} @else if index($output, warn) {
|
25
13
|
@warn $message;
|
26
|
-
@each $line in $lines {
|
27
|
-
@if index($lines, $line) == length($lines) {
|
28
|
-
@warn $line;
|
29
|
-
} @else {
|
30
|
-
@debug $line;
|
31
|
-
}
|
32
|
-
}
|
33
14
|
}
|
34
15
|
}
|
data/sass/true/_modules.scss
CHANGED
@@ -23,7 +23,9 @@ $module-results: null;
|
|
23
23
|
) {
|
24
24
|
// Initial CSS Output
|
25
25
|
@if index($output, css) {
|
26
|
-
@include result-message('
|
26
|
+
@include result-message('
|
27
|
+
|
28
|
+
### #{$name} ------', css);
|
27
29
|
}
|
28
30
|
}
|
29
31
|
|
@@ -48,13 +50,11 @@ $module-results: null;
|
|
48
50
|
$pass: map-get($module-results, pass);
|
49
51
|
$fail: map-get($module-results, fail);
|
50
52
|
|
51
|
-
$css-message: '
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
@include spacer-comment;
|
53
|
+
$css-message: '
|
54
|
+
#{$run} Tests:
|
55
|
+
- #{$pass} Passed
|
56
|
+
- #{$fail} Failed';
|
56
57
|
@include result-message($css-message, css);
|
57
|
-
@include spacer-comment;
|
58
58
|
}
|
59
59
|
|
60
60
|
// Add to Total
|
data/sass/true/_utilities.scss
CHANGED
@@ -36,16 +36,3 @@
|
|
36
36
|
@return $return + ')';
|
37
37
|
}
|
38
38
|
}
|
39
|
-
|
40
|
-
// Split a string
|
41
|
-
@function str-split($string, $substring) {
|
42
|
-
$strings: ();
|
43
|
-
$found-at: str-index($string, $substring);
|
44
|
-
@while $found-at {
|
45
|
-
$strings: if($found-at > 1, append($strings, str-slice($string, 1, $found-at - 1)), $strings);
|
46
|
-
$string: str-slice($string, $found-at + str-length($substring));
|
47
|
-
$found-at: str-index($string, $substring);
|
48
|
-
}
|
49
|
-
$strings: append($strings, $string);
|
50
|
-
@return $strings;
|
51
|
-
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 'true'
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Meyer
|
@@ -75,12 +75,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- - '
|
78
|
+
- - '>='
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 1.
|
80
|
+
version: '1.2'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project: 'true'
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.0.3
|
84
84
|
signing_key:
|
85
85
|
specification_version: 3
|
86
86
|
summary: Testing framework for Sass libraries.
|