true 0.2.0.rc.5 → 0.2.0

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: d488bdf97d767567bd69863e30e5be9a4bef1e08
4
- data.tar.gz: 4e1b64a74971935e9634f9acc831c0930233590d
3
+ metadata.gz: 66a0f767a421a3ff94af9713fb2c1291503494f8
4
+ data.tar.gz: 6a4b3366382ebefe0e8b6580942f844b513358a3
5
5
  SHA512:
6
- metadata.gz: 6581421c2b9ddd1694268fa3bef367d17424e414f0d9e23969d800937573789b135fd9680a26f29e3b3f0d9d04c615402e8c65e93a8c0fe4380fddfad898ca35
7
- data.tar.gz: 94c2be3d151cac2dda2e786bcbecfeb6258ad85d4f166210c273b211191c481caeea7ddb73b7fc575eb6752fe3652055de02d1da4fdedc2d483c322e6fe901a7
6
+ metadata.gz: 04275f2cef76283d41e844fa761290f1b5b8988d5e42b42fb89e4b88fd69eace8c96ed79336c12e6fa57bce5f02df71d32aabf2ebf1640fbe8307573773d23a4
7
+ data.tar.gz: bfe9aae3a9032e680ace7b0f16b08633c04bcc21c997b128ab7e0d41c963dd3de9d7825a0cd31a4deb24339cbd2351740d1080420221988e71abe39e3f801bb2
@@ -1,8 +1,8 @@
1
1
  True Changelog
2
2
  ==============
3
3
 
4
- 0.2.0 (7/15/14)
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
- 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
-
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.rc.4
1
+ 0.2.0
@@ -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.key? 'SASS_PATH'
8
- ENV['SASS_PATH'] += File::PATH_SEPARATOR + true_stylesheets_path
7
+ if ENV.has_key?("SASSPATH")
8
+ ENV["SASSPATH"] = ENV["SASSPATH"] + File::PATH_SEPARATOR + true_stylesheets_path
9
9
  else
10
- ENV['SASS_PATH'] = true_stylesheets_path
10
+ ENV["SASSPATH"] = true_stylesheets_path
11
11
  end
12
12
  end
@@ -5,20 +5,20 @@
5
5
  $assert,
6
6
  $fail-message: ''
7
7
  ) {
8
- $name: map-get($test-results, name);
9
- $debug-message: '#{inspect($assert)} is not true';
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($name, $result, $fail-message, $debug-message...);
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
- $name: map-get($test-results, name);
19
- $debug-message: '#{inspect($assert)} is not false';
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($name, $result, $fail-message, $debug-message...);
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
- $name: map-get($test-results, name);
30
- $debug-message: 'Expected: #{inspect($expected)}',
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($name, $result, $fail-message, $debug-message...);
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
- $name: map-get($test-results, name);
42
- $debug-message: 'Expected: #{inspect($expected)}',
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: false,
56
- $debug...
51
+ $fail-message: ''
57
52
  ) {
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
- }
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
  }
@@ -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
- @each $line in $lines {
18
- /* #{$line} */
19
- }
9
+ /* #{$message} */
20
10
  } @else if index($output, debug) or index($output, terminal) {
21
- @each $line in $lines {
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
  }
@@ -23,7 +23,9 @@ $module-results: null;
23
23
  ) {
24
24
  // Initial CSS Output
25
25
  @if index($output, css) {
26
- @include result-message('#{$-tnl}### #{$name} ----------', css);
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: '#{$-tnl}#{$run} Tests:' +
52
- '#{$-tnl}- #{$pass} Passed' +
53
- '#{$-tnl}- #{$fail} Failed';
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
@@ -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.rc.5
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.3.1
80
+ version: '1.2'
81
81
  requirements: []
82
82
  rubyforge_project: 'true'
83
- rubygems_version: 2.1.10
83
+ rubygems_version: 2.0.3
84
84
  signing_key:
85
85
  specification_version: 3
86
86
  summary: Testing framework for Sass libraries.