true 0.2.0.rc.4 → 0.2.0.rc.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1f1153504422b79704b5dc7d760eebbf22960a5
4
- data.tar.gz: d97bde88b3574e2d50f7ca3002c7b7046349bf42
3
+ metadata.gz: d488bdf97d767567bd69863e30e5be9a4bef1e08
4
+ data.tar.gz: 4e1b64a74971935e9634f9acc831c0930233590d
5
5
  SHA512:
6
- metadata.gz: ed0b1b6c8b0b95caa0f398e4a5931cde21b1567e6efed18513f7d429401f2df71b520515eac5297a26e4510f3047c42775cbcc4fb3665e5546f8940d130b3059
7
- data.tar.gz: 0e6e00b1a2252c3275955f53e60781f2dafd21bf8ffe8754ee696bfc1f1a7d747eebab538eb4f0379b2fde8fc7ddd7c1868700d272dbe585e2587a45074dbd21
6
+ metadata.gz: 6581421c2b9ddd1694268fa3bef367d17424e414f0d9e23969d800937573789b135fd9680a26f29e3b3f0d9d04c615402e8c65e93a8c0fe4380fddfad898ca35
7
+ data.tar.gz: 94c2be3d151cac2dda2e786bcbecfeb6258ad85d4f166210c273b211191c481caeea7ddb73b7fc575eb6752fe3652055de02d1da4fdedc2d483c322e6fe901a7
data/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
1
  True Changelog
2
2
  ==============
3
3
 
4
- 0.2.0 (unreleased)
5
- ------------------
4
+ 0.2.0 (7/15/14)
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,32 +10,40 @@ 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. Compass is
14
- no longer an explicit dependency.
13
+ - Only register as a compass extension if compass is present.
14
+ Compass is no longer an explicit dependency.
15
+ - Adjust the output styles to work with Sass 3.4
16
+ and have more visual consistency.
17
+
15
18
 
16
19
  0.1.5 (6/10/13)
17
20
  ---------------
18
21
  - Append actual results to custom failure messages.
19
22
 
23
+
20
24
  0.1.4 (6/9/13)
21
25
  --------------
22
26
  - Null result is considered a failure.
23
27
  - Allow output to be turned off for certain modules/tests/assertions.
24
28
 
29
+
25
30
  0.1.3 (6/7/13)
26
31
  --------------
27
32
  - Nest assertions within `test() {}` named tests.
28
33
  - Cleaner css output.
29
34
 
35
+
30
36
  0.1.2 (6/7/13)
31
37
  --------------
32
38
  - Use nesting for modules with `test-module() {}`
33
39
  - Added failure message argument to all assertions.
34
40
 
41
+
35
42
  0.1.1 (6/6/13)
36
43
  --------------
37
44
  - Fix bug in `lib/true.rb` compass plugin registration.
38
45
 
46
+
39
47
  0.1.0 (6/6/13)
40
48
  --------------
41
49
  - `assert-true()`, `assert-false()`, `assert-equal()`, and `assert-unequal()`.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0.rc.3
1
+ 0.2.0.rc.4
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.has_key?("SASSPATH")
8
- ENV["SASSPATH"] = ENV["SASSPATH"] + File::PATH_SEPARATOR + true_stylesheets_path
7
+ if ENV.key? 'SASS_PATH'
8
+ ENV['SASS_PATH'] += File::PATH_SEPARATOR + true_stylesheets_path
9
9
  else
10
- ENV["SASSPATH"] = true_stylesheets_path
10
+ ENV['SASS_PATH'] = true_stylesheets_path
11
11
  end
12
12
  end
@@ -5,20 +5,20 @@
5
5
  $assert,
6
6
  $fail-message: ''
7
7
  ) {
8
- $test: map-get($test-results, name);
9
- $fail-message: '#{$test}: ' + $fail-message + ' (#{inspect($assert)} is not true)';
8
+ $name: map-get($test-results, name);
9
+ $debug-message: '#{inspect($assert)} is not true';
10
10
  $result: if($assert, pass, fail);
11
- @include report-assert($result, $fail-message);
11
+ @include report-assert($name, $result, $fail-message, $debug-message...);
12
12
  }
13
13
 
14
14
  @mixin assert-false(
15
15
  $assert,
16
16
  $fail-message: ''
17
17
  ) {
18
- $test: map-get($test-results, name);
19
- $fail-message: '#{$test}: ' + $fail-message + ' (#{inspect($assert)} is not false)';
18
+ $name: map-get($test-results, name);
19
+ $debug-message: '#{inspect($assert)} is not false';
20
20
  $result: if(not $assert, pass, fail);
21
- @include report-assert($result, $fail-message);
21
+ @include report-assert($name, $result, $fail-message, $debug-message...);
22
22
  }
23
23
 
24
24
  @mixin assert-equal(
@@ -26,10 +26,11 @@
26
26
  $expected,
27
27
  $fail-message: ''
28
28
  ) {
29
- $test: map-get($test-results, name);
30
- $fail-message: '#{$test}: ' + $fail-message + ' (Expected: #{inspect($expected)} != Result: #{inspect($assert)})';
29
+ $name: map-get($test-results, name);
30
+ $debug-message: 'Expected: #{inspect($expected)}',
31
+ 'Result: #{inspect($assert)}';
31
32
  $result: if($assert == $expected, pass, fail);
32
- @include report-assert($result, $fail-message);
33
+ @include report-assert($name, $result, $fail-message, $debug-message...);
33
34
  }
34
35
 
35
36
  @mixin assert-unequal(
@@ -37,21 +38,34 @@
37
38
  $expected,
38
39
  $fail-message: ''
39
40
  ) {
40
- $test: map-get($test-results, name);
41
- $fail-message: '#{$test}: ' + $fail-message + ' (Expected: #{inspect($expected)} == Result: #{inspect($assert)})';
41
+ $name: map-get($test-results, name);
42
+ $debug-message: 'Expected: #{inspect($expected)}',
43
+ 'Result: #{inspect($assert)}';
42
44
  $result: if($assert != $expected, pass, fail);
43
- @include report-assert($result, $fail-message);
45
+
46
+ @include report-assert($name, $result, $fail-message, $debug-message...);
44
47
  }
45
48
 
46
49
  // Pass / Fail
47
50
  // -----------
48
51
 
49
52
  @mixin report-assert(
53
+ $name,
50
54
  $result,
51
- $fail-message: ''
55
+ $fail-message: false,
56
+ $debug...
52
57
  ) {
53
- @if $result == fail and $fail-message {
54
- @warn $fail-message;
58
+ @if $result == fail {
59
+ @debug 'FAIL: #{$name}';
60
+
61
+ @each $item in $debug {
62
+ @debug $item;
63
+ }
64
+
65
+ @if $fail-message {
66
+ @warn $fail-message;
67
+ }
55
68
  }
69
+
56
70
  $test-results: map-add($test-results, (run: 1, $result: 1)) !global;
57
71
  }
@@ -1,15 +1,34 @@
1
1
  // Messages
2
2
  // ========
3
3
 
4
+ $-tnl: "\a";
5
+
6
+ @mixin spacer-comment() {
7
+ /*
8
+ */
9
+ }
10
+
4
11
  @mixin result-message(
5
12
  $message,
6
13
  $output
7
14
  ) {
15
+ $lines: str-split($message, $-tnl);
8
16
  @if index($output, css) {
9
- /* #{$message} */
17
+ @each $line in $lines {
18
+ /* #{$line} */
19
+ }
10
20
  } @else if index($output, debug) or index($output, terminal) {
11
- @debug $message;
21
+ @each $line in $lines {
22
+ @debug $line;
23
+ }
12
24
  } @else if index($output, warn) {
13
25
  @warn $message;
26
+ @each $line in $lines {
27
+ @if index($lines, $line) == length($lines) {
28
+ @warn $line;
29
+ } @else {
30
+ @debug $line;
31
+ }
32
+ }
14
33
  }
15
34
  }
@@ -23,9 +23,7 @@ $module-results: null;
23
23
  ) {
24
24
  // Initial CSS Output
25
25
  @if index($output, css) {
26
- @include result-message('
27
-
28
- ### #{$name} ------', css);
26
+ @include result-message('#{$-tnl}### #{$name} ----------', css);
29
27
  }
30
28
  }
31
29
 
@@ -50,11 +48,13 @@ $module-results: null;
50
48
  $pass: map-get($module-results, pass);
51
49
  $fail: map-get($module-results, fail);
52
50
 
53
- $css-message: '
54
- #{$run} Tests:
55
- - #{$pass} Passed
56
- - #{$fail} Failed';
51
+ $css-message: '#{$-tnl}#{$run} Tests:' +
52
+ '#{$-tnl}- #{$pass} Passed' +
53
+ '#{$-tnl}- #{$fail} Failed';
54
+
55
+ @include spacer-comment;
57
56
  @include result-message($css-message, css);
57
+ @include spacer-comment;
58
58
  }
59
59
 
60
60
  // Add to Total
@@ -36,3 +36,16 @@
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.rc.4
4
+ version: 0.2.0.rc.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Meyer
@@ -14,16 +14,22 @@ dependencies:
14
14
  name: sass
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.0.rc.1
19
+ version: 3.3.0
20
+ - - <
21
+ - !ruby/object:Gem::Version
22
+ version: '3.5'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ~>
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.3.0
30
+ - - <
25
31
  - !ruby/object:Gem::Version
26
- version: 3.3.0.rc.1
32
+ version: '3.5'
27
33
  description: Unit tests for maintaining test-driven Sass libraries.
28
34
  email:
29
35
  - eric@oddbird.net