true 2.1.3 → 2.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.
@@ -1,79 +1,12 @@
1
1
  // True Settings
2
2
  // =============
3
3
 
4
+
5
+
6
+ // Terminal Output
7
+ // ---------------
4
8
  /// Whether or not to use the terminal as output stream
5
9
  /// @access public
6
10
  /// @group reporting
7
11
  /// @type Bool
8
12
  $true-terminal-output: true !default;
9
-
10
-
11
- // Context (private)
12
- // -----------------
13
-
14
- /// True current context
15
- /// @access private
16
- /// @group x_private
17
- /// @type Map
18
- /// @prop {String} module [null]
19
- /// @prop {String} test [null]
20
- /// @prop {String} assert [null]
21
- $_true-context: ();
22
-
23
- /// Update the current context
24
- /// @access private
25
- /// @group x_private
26
- /// @param {String} $scope - Either `module`, `test` or `assert`
27
- /// @param {String} $name - Name of current scope
28
- /// @require $_true-context
29
- @mixin _true-context(
30
- $scope,
31
- $name
32
- ) {
33
- $_true-context: append($_true-context, ($scope, $name)) !global;
34
- }
35
-
36
- @mixin _true-context-pop() {
37
- $new: ();
38
- @for $i from 1 to length($_true-context) {
39
- $new: append($new, nth($_true-context, $i));
40
- }
41
- $_true-context: $new !global;
42
- }
43
-
44
- /// Get information on current context
45
- /// @access private
46
- /// @group x_private
47
- /// @param {String} $scope - Either `module`, `test` or `assert`
48
- /// @return {String}
49
- @function _true-context(
50
- $scope
51
- ) {
52
- @for $i from length($_true-context) through 1 {
53
- $entry: nth($_true-context, $i);
54
- $entry-scope: nth($entry, 1);
55
- @if $entry-scope == $scope {
56
- @return nth($entry, 2);
57
- }
58
- }
59
- @return null;
60
- }
61
-
62
- /// Get list of context names
63
- /// @access private
64
- /// @group x_private
65
- /// @param {String} $scope - Either `module`, `test` or `assert`
66
- /// @return {List}
67
- @function _true-context-all(
68
- $scope
69
- ) {
70
- $list: ();
71
- @for $i from 1 through length($_true-context) {
72
- $entry: nth($_true-context, $i);
73
- $entry-scope: nth($entry, 1);
74
- @if $entry-scope == $scope {
75
- $list: append($list, nth($entry, 2));
76
- }
77
- }
78
- @return $list;
79
- }
@@ -1,13 +1,14 @@
1
1
  // Tests
2
2
  // =====
3
3
 
4
+
5
+
6
+ // Test
7
+ // ----
4
8
  /// Describe a Test
5
9
  /// @access public
6
10
  /// @group testing
7
11
  /// @param {String} $name - Test bame
8
- /// @require {mixin}_true-test-start
9
- /// @require {mixin}_true-test-stop
10
- /// @require {function} _true-selector
11
12
  /// @content Include the assertions that are part of this test
12
13
  @mixin test(
13
14
  $name
@@ -18,15 +19,12 @@
18
19
  }
19
20
 
20
21
 
21
- // Module Start (private)
22
- // ----------------------
23
22
 
23
+ // Test Start
24
+ // ----------
24
25
  /// Test start helper
25
26
  /// @access private
26
- /// @group x_private
27
27
  /// @param {String} $name - Test name
28
- /// @require {mixin} _true-context
29
- /// @require {mixin} _true-message
30
28
  @mixin _true-test-start(
31
29
  $name
32
30
  ) {
@@ -35,16 +33,13 @@
35
33
  }
36
34
 
37
35
 
38
- // Module Stop (private)
39
- // ---------------------
40
36
 
37
+ // Test Stop
38
+ // ---------
41
39
  /// Test stop helper
42
40
  /// @access private
43
- /// @group x_private
44
- /// @require {mixin} _true-context
45
- /// @require {mixin} _true-message
46
- /// @require {function} _true-get-result
47
41
  @mixin _true-test-stop {
42
+ @include _true-update($_true-test-result);
48
43
  @include _true-context-pop();
49
44
  @include _true-message('', 'comments');
50
45
  }
@@ -1,11 +1,16 @@
1
1
  // Utilities
2
2
  // =========
3
3
 
4
+
5
+
6
+ // Map Increment
7
+ // -------------
4
8
  /// Add map values together
5
9
  /// @access private
6
- /// @group x_private
7
- /// @param {Map} $base - Initial map
8
- /// @param {Map} $add - Extra map
10
+ /// @param {Map} $base -
11
+ /// Initial map to add values to
12
+ /// @param {Map} $add -
13
+ /// Map of values to be added
9
14
  /// @return {Map}
10
15
  @function _true-map-increment(
11
16
  $base,
@@ -24,12 +29,18 @@
24
29
  @return $base;
25
30
  }
26
31
 
27
- /// Split a string
32
+
33
+
34
+ // String Split
35
+ // ------------
36
+ /// Split a string into a list
28
37
  /// @access private
29
- /// @group x_private
30
- /// @param {String} $string - String to split
31
- /// @param {String} $substring - Delimiter
32
- /// @return {List} - `$string` fragments
38
+ /// @param {String} $string -
39
+ /// String to split
40
+ /// @param {String} $substring -
41
+ /// Delimiter
42
+ /// @return {List} -
43
+ /// List of string fragments
33
44
  @function _true-str-split(
34
45
  $string,
35
46
  $substring
@@ -45,12 +56,18 @@
45
56
  @return $strings;
46
57
  }
47
58
 
48
- /// Join a list of strings
59
+
60
+
61
+ // String Join
62
+ // -----------
63
+ /// Join a list of strings into a single string
49
64
  /// @access private
50
- /// @group x_private
51
- /// @param {List} $list - List to join
52
- /// @param {String} $separator - Separator
53
- /// @return {String} - Joined string
65
+ /// @param {List} $list -
66
+ /// List of strings to join
67
+ /// @param {String} $separator -
68
+ /// Separator to add between items
69
+ /// @return {String} -
70
+ /// Joined string
54
71
  @function _true-str-join(
55
72
  $list,
56
73
  $separator
@@ -71,11 +88,15 @@
71
88
  }
72
89
 
73
90
 
74
- /// Check for strict equality
91
+
92
+ // Is Equal
93
+ // --------
94
+ /// Check for equality, excluding comparable numbers
75
95
  /// @access private
76
- /// @group x_private
77
- /// @param {*} $one - First value
78
- /// @param {*} $two - Second value
96
+ /// @param {*} $one -
97
+ /// First value
98
+ /// @param {*} $two -
99
+ /// Second value
79
100
  /// @return {Bool}
80
101
  @function _true-is-equal($one, $two) {
81
102
  @if type-of($one) == 'number' and type-of($two) == 'number' {
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: 2.1.3
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miriam Eric Suzanne
@@ -45,6 +45,7 @@ files:
45
45
  - lib/true.rb
46
46
  - sass/_true.scss
47
47
  - sass/true/_assert.scss
48
+ - sass/true/_context.scss
48
49
  - sass/true/_messages.scss
49
50
  - sass/true/_modules.scss
50
51
  - sass/true/_results.scss