oulu-rails 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +22 -0
  3. data/README.md +23 -0
  4. data/lib/oulu-rails/version.rb +3 -0
  5. data/lib/oulu-rails.rb +27 -0
  6. data/vendor/assets/javascripts/oulu/dev/positions-p.js.coffee +34 -0
  7. data/vendor/assets/javascripts/oulu/dev/positions-pp.js.coffee +57 -0
  8. data/vendor/assets/javascripts/oulu/dev/positions.js.coffee +6 -0
  9. data/vendor/assets/javascripts/oulu/helpers/js-autosize.js.coffee +2 -0
  10. data/vendor/assets/javascripts/oulu/helpers/js-checkbox.js.coffee +6 -0
  11. data/vendor/assets/javascripts/oulu/helpers/js-click-animate.js.coffee +8 -0
  12. data/vendor/assets/javascripts/oulu/helpers/js-delay-hidden.js.coffee +4 -0
  13. data/vendor/assets/javascripts/oulu/helpers/js-focused.js.coffee +7 -0
  14. data/vendor/assets/javascripts/oulu/helpers/js-hack.js.coffee +8 -0
  15. data/vendor/assets/javascripts/oulu/helpers/js-hide-after.j.coffee +5 -0
  16. data/vendor/assets/javascripts/oulu/helpers/js-hover-z-index.js.coffee +5 -0
  17. data/vendor/assets/javascripts/oulu/helpers/js-hovered.js.coffee +17 -0
  18. data/vendor/assets/javascripts/oulu/helpers/js-one-animate.js.coffee +5 -0
  19. data/vendor/assets/javascripts/oulu/helpers/js-open-children.js.coffee +28 -0
  20. data/vendor/assets/javascripts/oulu/helpers/js-open.js.coffee +51 -0
  21. data/vendor/assets/javascripts/oulu/helpers/js-scroll-to-top.js.coffee +11 -0
  22. data/vendor/assets/javascripts/oulu/helpers/js-scroll.js.coffee +9 -0
  23. data/vendor/assets/javascripts/oulu/helpers/js-side-slide.js.coffee +6 -0
  24. data/vendor/assets/javascripts/oulu/helpers/js-window-loading.js.coffee +15 -0
  25. data/vendor/assets/javascripts/oulu/helpers/js-window-sizes.js.coffee +6 -0
  26. data/vendor/assets/javascripts/oulu/helpers/open-close.js.coffee +23 -0
  27. data/vendor/assets/javascripts/oulu/ie/PIE_IE678.js +72 -0
  28. data/vendor/assets/javascripts/oulu/ie/PIE_IE9.js +46 -0
  29. data/vendor/assets/javascripts/oulu/ie/ie-selectors.js.coffee +3 -0
  30. data/vendor/assets/javascripts/oulu/ie/ie8-selectors.js.coffee +3 -0
  31. data/vendor/assets/javascripts/oulu/ie/ie9-selectors.js.coffee +6 -0
  32. data/vendor/assets/javascripts/oulu/ie/jquery.belatedPNG.min.js +29 -0
  33. data/vendor/assets/javascripts/oulu/ie/jquery.linkscubber.js +7 -0
  34. data/vendor/assets/javascripts/oulu/ie/svgeezy.min.js +12 -0
  35. data/vendor/assets/javascripts/oulu/plugins/check-box.js.coffee +34 -0
  36. data/vendor/assets/javascripts/oulu/plugins/footerFixed.js +74 -0
  37. data/vendor/assets/javascripts/oulu/plugins/jquery.autosize.min.js +7 -0
  38. data/vendor/assets/javascripts/oulu/plugins/jquery.cheat-code.js +63 -0
  39. data/vendor/assets/javascripts/oulu/plugins/jquery.css3form.js +195 -0
  40. data/vendor/assets/javascripts/oulu/plugins/jquery.depend.min.js +13 -0
  41. data/vendor/assets/javascripts/oulu/plugins/sns-buttons.js +339 -0
  42. data/vendor/assets/javascripts/oulu-ie8.js +6 -0
  43. data/vendor/assets/javascripts/oulu-ie9.js +2 -0
  44. data/vendor/assets/javascripts/oulu.js +2 -0
  45. data/vendor/assets/stylesheets/_oulu-base.css.sass +86 -0
  46. data/vendor/assets/stylesheets/_oulu.css.sass +13 -0
  47. data/vendor/assets/stylesheets/bootcamp/CHANGELOG.md +70 -0
  48. data/vendor/assets/stylesheets/bootcamp/CONTRIBUTING.md +72 -0
  49. data/vendor/assets/stylesheets/bootcamp/Gruntfile.coffee +34 -0
  50. data/vendor/assets/stylesheets/bootcamp/LICENSE.md +7 -0
  51. data/vendor/assets/stylesheets/bootcamp/README.md +52 -0
  52. data/vendor/assets/stylesheets/bootcamp/bower.json +15 -0
  53. data/vendor/assets/stylesheets/bootcamp/dist/_bootcamp.scss +46 -0
  54. data/vendor/assets/stylesheets/bootcamp/dist/bootcamp.coffee +101 -0
  55. data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_actual.scss +3 -0
  56. data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_error.scss +29 -0
  57. data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_expect.scss +6 -0
  58. data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_not-to.scss +5 -0
  59. data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_should.scss +6 -0
  60. data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_to.scss +5 -0
  61. data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_describe.scss +31 -0
  62. data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_it.scss +31 -0
  63. data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_runner.scss +28 -0
  64. data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_should.scss +46 -0
  65. data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_xdescribe.scss +9 -0
  66. data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_xit.scss +9 -0
  67. data/vendor/assets/stylesheets/bootcamp/dist/core/variables/_helpers.scss +5 -0
  68. data/vendor/assets/stylesheets/bootcamp/dist/core/variables/_settings.scss +2 -0
  69. data/vendor/assets/stylesheets/bootcamp/dist/core/variables/_should.scss +6 -0
  70. data/vendor/assets/stylesheets/bootcamp/dist/core/variables/_trackers.scss +6 -0
  71. data/vendor/assets/stylesheets/bootcamp/dist/lib/_sassyjson.scss +1075 -0
  72. data/vendor/assets/stylesheets/bootcamp/dist/matchers/_be.scss +3 -0
  73. data/vendor/assets/stylesheets/bootcamp/dist/matchers/_equal.scss +3 -0
  74. data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_be-empty.scss +3 -0
  75. data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_be-longer-than.scss +3 -0
  76. data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_be-shorter-than.scss +3 -0
  77. data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_contain.scss +3 -0
  78. data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_deep-contain.scss +3 -0
  79. data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_deep-equal.scss +47 -0
  80. data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_have-length-of.scss +3 -0
  81. data/vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-close-to.scss +12 -0
  82. data/vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-greater-than.scss +12 -0
  83. data/vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-less-than.scss +12 -0
  84. data/vendor/assets/stylesheets/bootcamp/dist/matchers/types/_be-falsy.scss +3 -0
  85. data/vendor/assets/stylesheets/bootcamp/dist/matchers/types/_be-null.scss +3 -0
  86. data/vendor/assets/stylesheets/bootcamp/dist/matchers/types/_be-truthy.scss +3 -0
  87. data/vendor/assets/stylesheets/bootcamp/dist/matchers/types/_have-type-of.scss +3 -0
  88. data/vendor/assets/stylesheets/bootcamp/dist/utils/_contain.scss +15 -0
  89. data/vendor/assets/stylesheets/bootcamp/dist/utils/_equal.scss +23 -0
  90. data/vendor/assets/stylesheets/bootcamp/dist/utils/_list-join.scss +35 -0
  91. data/vendor/assets/stylesheets/bootcamp/dist/utils/_power.scss +15 -0
  92. data/vendor/assets/stylesheets/bootcamp/package.json +63 -0
  93. data/vendor/assets/stylesheets/bootcamp/tasks/bootcamp.coffee +83 -0
  94. data/vendor/assets/stylesheets/bootcamp/test/core/functions/_actual.scss +10 -0
  95. data/vendor/assets/stylesheets/bootcamp/test/core/functions/_expect.scss +6 -0
  96. data/vendor/assets/stylesheets/bootcamp/test/core/functions/_not-to.scss +5 -0
  97. data/vendor/assets/stylesheets/bootcamp/test/core/functions/_should.scss +10 -0
  98. data/vendor/assets/stylesheets/bootcamp/test/core/functions/_to.scss +5 -0
  99. data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_describe.scss +11 -0
  100. data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_it.scss +5 -0
  101. data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_should.scss +5 -0
  102. data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_xdescribe.scss +28 -0
  103. data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_xit.scss +12 -0
  104. data/vendor/assets/stylesheets/bootcamp/test/matchers/_be.scss +90 -0
  105. data/vendor/assets/stylesheets/bootcamp/test/matchers/_equal.scss +33 -0
  106. data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_be-empty.scss +12 -0
  107. data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_be-longer-than.scss +29 -0
  108. data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_be-shorter-than.scss +29 -0
  109. data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_contain.scss +39 -0
  110. data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_deep-contain.scss +51 -0
  111. data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_deep-equal.scss +151 -0
  112. data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_have-length-of.scss +31 -0
  113. data/vendor/assets/stylesheets/bootcamp/test/matchers/numbers/_be-close-to.scss +24 -0
  114. data/vendor/assets/stylesheets/bootcamp/test/matchers/numbers/_be-greater-than.scss +16 -0
  115. data/vendor/assets/stylesheets/bootcamp/test/matchers/numbers/_be-less-than.scss +16 -0
  116. data/vendor/assets/stylesheets/bootcamp/test/matchers/types/_be-falsy.scss +14 -0
  117. data/vendor/assets/stylesheets/bootcamp/test/matchers/types/_be-null.scss +13 -0
  118. data/vendor/assets/stylesheets/bootcamp/test/matchers/types/_be-truthy.scss +13 -0
  119. data/vendor/assets/stylesheets/bootcamp/test/matchers/types/_have-type-of.scss +17 -0
  120. data/vendor/assets/stylesheets/bootcamp/test/specs.scss +45 -0
  121. data/vendor/assets/stylesheets/bootcamp/test/utils/_contain.scss +41 -0
  122. data/vendor/assets/stylesheets/bootcamp/test/utils/_equal.scss +79 -0
  123. data/vendor/assets/stylesheets/bootcamp/test/utils/_list-join.scss +39 -0
  124. data/vendor/assets/stylesheets/bootcamp/test/utils/_power.scss +13 -0
  125. data/vendor/assets/stylesheets/helper/_base-helper.css.sass +133 -0
  126. data/vendor/assets/stylesheets/helper/_click-actions.css.sass +188 -0
  127. data/vendor/assets/stylesheets/helper/_fade-actions.css.sass +30 -0
  128. data/vendor/assets/stylesheets/helper/_margin-padding.css.sass +16 -0
  129. data/vendor/assets/stylesheets/helper/_typoglaphy.css.sass +9 -0
  130. data/vendor/assets/stylesheets/options/amazlet/_amazlet.css.sass +32 -0
  131. data/vendor/assets/stylesheets/options/glitch/_glitch.css.sass +31 -0
  132. data/vendor/assets/stylesheets/options/oulu-buttons/_button-basic.css.sass +31 -0
  133. data/vendor/assets/stylesheets/options/web-fonts/_cousine.css.sass +12 -0
  134. data/vendor/assets/stylesheets/options/web-fonts/_font-awsome.css.sass +8 -0
  135. data/vendor/assets/stylesheets/options/web-fonts/_icomoon.css.sass +10 -0
  136. data/vendor/assets/stylesheets/options/web-fonts/_lato.css.sass +12 -0
  137. data/vendor/assets/stylesheets/options/web-fonts/_montserrat.css.sass +13 -0
  138. data/vendor/assets/stylesheets/options/web-fonts/_old-standard.css.sass +12 -0
  139. data/vendor/assets/stylesheets/options/web-fonts/_open-sans.css.sass +11 -0
  140. data/vendor/assets/stylesheets/options/web-fonts/_podkova.css.sass +12 -0
  141. data/vendor/assets/stylesheets/options/web-fonts/_pt-sans.css.sass +12 -0
  142. data/vendor/assets/stylesheets/options/web-fonts/_roboto.css.sass +11 -0
  143. data/vendor/assets/stylesheets/options/web-fonts/_satisfy.css.sass +13 -0
  144. data/vendor/assets/stylesheets/options/web-fonts/_source-code-pro.css.sass +13 -0
  145. data/vendor/assets/stylesheets/options/web-fonts/_source-sans-pro.css.sass +13 -0
  146. data/vendor/assets/stylesheets/options/web-fonts/_special-elite.css.sass +12 -0
  147. data/vendor/assets/stylesheets/options/web-fonts/_tauri.css.sass +11 -0
  148. data/vendor/assets/stylesheets/options/web-fonts/_ubuntu.css.sass +12 -0
  149. data/vendor/assets/stylesheets/settings/functions/_background.css.sass +60 -0
  150. data/vendor/assets/stylesheets/settings/functions/_bool.css.sass +5 -0
  151. data/vendor/assets/stylesheets/settings/functions/_border.css.sass +47 -0
  152. data/vendor/assets/stylesheets/settings/functions/_color.css.sass +65 -0
  153. data/vendor/assets/stylesheets/settings/functions/_content.css.sass +5 -0
  154. data/vendor/assets/stylesheets/settings/functions/_cursor.css.sass +5 -0
  155. data/vendor/assets/stylesheets/settings/functions/_direction.css.sass +8 -0
  156. data/vendor/assets/stylesheets/settings/functions/_image.css.sass +8 -0
  157. data/vendor/assets/stylesheets/settings/functions/_length.css.sass +20 -0
  158. data/vendor/assets/stylesheets/settings/functions/_list.css.sass +11 -0
  159. data/vendor/assets/stylesheets/settings/functions/_map.css.sass +5 -0
  160. data/vendor/assets/stylesheets/settings/functions/_number.css.sass +63 -0
  161. data/vendor/assets/stylesheets/settings/functions/_position.css.sass +47 -0
  162. data/vendor/assets/stylesheets/settings/functions/_reverse.css.sass +22 -0
  163. data/vendor/assets/stylesheets/settings/functions/_string.css.sass +5 -0
  164. data/vendor/assets/stylesheets/settings/functions/_text.css.sass +34 -0
  165. data/vendor/assets/stylesheets/settings/initializers/_reset.css.sass +85 -0
  166. data/vendor/assets/stylesheets/settings/mixins/_animation.css.sass +15 -0
  167. data/vendor/assets/stylesheets/settings/mixins/_background.css.sass +33 -0
  168. data/vendor/assets/stylesheets/settings/mixins/_balloon-tale.css.sass +111 -0
  169. data/vendor/assets/stylesheets/settings/mixins/_basic-font.css.sass +40 -0
  170. data/vendor/assets/stylesheets/settings/mixins/_block.css.sass +30 -0
  171. data/vendor/assets/stylesheets/settings/mixins/_border.css.sass +28 -0
  172. data/vendor/assets/stylesheets/settings/mixins/_button-base.css.sass +27 -0
  173. data/vendor/assets/stylesheets/settings/mixins/_clear-type.css.sass +4 -0
  174. data/vendor/assets/stylesheets/settings/mixins/_color.css.sass +9 -0
  175. data/vendor/assets/stylesheets/settings/mixins/_filters.css.sass +5 -0
  176. data/vendor/assets/stylesheets/settings/mixins/_form.css.sass +7 -0
  177. data/vendor/assets/stylesheets/settings/mixins/_grids.css.sass +149 -0
  178. data/vendor/assets/stylesheets/settings/mixins/_html5-input-types.scss +118 -0
  179. data/vendor/assets/stylesheets/settings/mixins/_ie-hacks.css.sass +8 -0
  180. data/vendor/assets/stylesheets/settings/mixins/_lines.css.sass +18 -0
  181. data/vendor/assets/stylesheets/settings/mixins/_link.css.sass +11 -0
  182. data/vendor/assets/stylesheets/settings/mixins/_list.css.sass +21 -0
  183. data/vendor/assets/stylesheets/settings/mixins/_margin-padding.css.sass +69 -0
  184. data/vendor/assets/stylesheets/settings/mixins/_overlay.css.sass +5 -0
  185. data/vendor/assets/stylesheets/settings/mixins/_positions.css.sass +28 -0
  186. data/vendor/assets/stylesheets/settings/mixins/_rem.css.sass +53 -0
  187. data/vendor/assets/stylesheets/settings/mixins/_resets.css.sass +17 -0
  188. data/vendor/assets/stylesheets/settings/mixins/_responsive-utilities.css.sass +160 -0
  189. data/vendor/assets/stylesheets/settings/mixins/_sassmatic.css.sass +172 -0
  190. data/vendor/assets/stylesheets/settings/mixins/_sprite-background.css.sass +18 -0
  191. data/vendor/assets/stylesheets/settings/mixins/_tables.css.sass +14 -0
  192. data/vendor/assets/stylesheets/settings/mixins/_text.css.sass +21 -0
  193. data/vendor/assets/stylesheets/settings/variables/_default.css.sass +69 -0
  194. metadata +362 -0
@@ -0,0 +1,3 @@
1
+ @function be($value) {
2
+ @return should("be", $value, bc-util-equal( actual(), $value ) );
3
+ }
@@ -0,0 +1,3 @@
1
+ @function equal($value) {
2
+ @return should("equal", $value, actual() == $value);
3
+ }
@@ -0,0 +1,3 @@
1
+ @function be-empty() {
2
+ @return should("be", "empty", actual() == ());
3
+ }
@@ -0,0 +1,3 @@
1
+ @function be-longer-than($this) {
2
+ @return should("be longer than", $this, length(actual()) > $this);
3
+ }
@@ -0,0 +1,3 @@
1
+ @function be-shorter-than($this) {
2
+ @return should("be shorter than", $this, length(actual()) < $this);
3
+ }
@@ -0,0 +1,3 @@
1
+ @function contain($value) {
2
+ @return should("deep contain", $value, bc-util-contain( actual(), $value ));
3
+ }
@@ -0,0 +1,3 @@
1
+ @function deep-contain($value) {
2
+ @return should("deep contain", $value, bc-util-contain( actual(), $value, $recursive: true ));
3
+ }
@@ -0,0 +1,47 @@
1
+ @function deep-equal($expected) {
2
+ $when: true;
3
+ $actual: actual();
4
+
5
+ $contains-list: true;
6
+ $temp-1: $actual;
7
+ $temp-2: $expected;
8
+
9
+ @while $contains-list {
10
+ $contains-list: false;
11
+
12
+ @if length($temp-1) == length($temp-2) {
13
+ @for $n from 1 through length($temp-1) {
14
+ $temp-1-item: nth($temp-1, $n);
15
+ $temp-2-item: nth($temp-2, $n);
16
+
17
+ @if type-of($temp-1-item) == "list" and type-of($temp-2-item) == "list" {
18
+ @if length($temp-1-item) == length($temp-2-item) {
19
+ @for $_n from 1 through length($temp-1-item) {
20
+ $_temp-1-item: nth($temp-1-item, $_n);
21
+ $_temp-2-item: nth($temp-2-item, $_n);
22
+
23
+ @if type-of($_temp-1-item) == "list" and type-of($_temp-2-item) == "list" {
24
+ $contains-list: true;
25
+ } @else if $_temp-1-item != $_temp-2-item {
26
+ $when: false;
27
+ }
28
+
29
+ $temp-1: $_temp-1-item;
30
+ $temp-2: $_temp-2-item;
31
+ }
32
+ } @else {
33
+ $when: false;
34
+ }
35
+ } @else if $temp-1-item != $temp-2-item {
36
+ $when: false;
37
+ }
38
+ }
39
+ } @else {
40
+ $when: false;
41
+ }
42
+ }
43
+
44
+ $throw: error("dep", "The `deep-equal` matcher has been deprecated, please use the `be` matcher for the same functionality");
45
+
46
+ @return should("deep equal", $expected, $when);
47
+ }
@@ -0,0 +1,3 @@
1
+ @function have-length-of($this) {
2
+ @return should("have length of", $this, length(actual()) == $this );
3
+ }
@@ -0,0 +1,12 @@
1
+ @function be-close-to($this, $precision) {
2
+ $actual: actual();
3
+ $when: false;
4
+
5
+ @if type-of($actual) == "number" {
6
+ $when: abs($this - $actual) < (bc-util-power(10, -$precision) / 2);
7
+ } @else {
8
+ $when: error("type", "The `be-close-to` matcher is only for numbers");
9
+ }
10
+
11
+ @return should("be close to", $this, $when);
12
+ }
@@ -0,0 +1,12 @@
1
+ @function be-greater-than($this) {
2
+ $actual: actual();
3
+ $when: false;
4
+
5
+ @if type-of($actual) == "number" {
6
+ $when: $actual > $this;
7
+ } @else {
8
+ $when: error("type", "The `be-greater-than` matcher is only for numbers");
9
+ }
10
+
11
+ @return should("be greater than", $this, $when);
12
+ }
@@ -0,0 +1,12 @@
1
+ @function be-less-than($this) {
2
+ $actual: actual();
3
+ $when: false;
4
+
5
+ @if type-of($actual) == "number" {
6
+ $when: $actual < $this;
7
+ } @else {
8
+ $when: error("type", "The `be-less-than` matcher is only for numbers");
9
+ }
10
+
11
+ @return should("be less than", $this, $when);
12
+ }
@@ -0,0 +1,3 @@
1
+ @function be-falsy() {
2
+ @return should("be", "falsy", not actual());
3
+ }
@@ -0,0 +1,3 @@
1
+ @function be-null() {
2
+ @return should("be", "null", actual() == null);
3
+ }
@@ -0,0 +1,3 @@
1
+ @function be-truthy() {
2
+ @return should("be", "truthy", not not actual());
3
+ }
@@ -0,0 +1,3 @@
1
+ @function have-type-of($type) {
2
+ @return should("have type of", $type, type-of(actual()) == $type);
3
+ }
@@ -0,0 +1,15 @@
1
+ @function bc-util-contain($list, $value, $recursive: false) {
2
+ @each $item in $list {
3
+ @if type-of( $item ) == list and $recursive {
4
+ @if bc-util-contain($item, $value, $recursive) {
5
+ @return true;
6
+ }
7
+ }
8
+
9
+ @if $item == $value {
10
+ @return true;
11
+ }
12
+ }
13
+
14
+ @return false;
15
+ }
@@ -0,0 +1,23 @@
1
+ @function bc-util-equal($value-1, $value-2, $recursive: true) {
2
+ @if length($value-1) != length($value-2) {
3
+ @return false;
4
+ }
5
+
6
+ @for $i from 1 through length($value-1) {
7
+
8
+ @if $recursive
9
+ and type-of( nth($value-1, $i) ) == list
10
+ and type-of( nth($value-2, $i) ) == list {
11
+
12
+ @if not bc-util-equal(nth($value-1, $i), nth($value-2, $i)) {
13
+ @return false;
14
+ }
15
+ }
16
+
17
+ @else if nth($value-1, $i) != nth($value-2, $i){
18
+ @return false;
19
+ }
20
+ }
21
+
22
+ @return true;
23
+ }
@@ -0,0 +1,35 @@
1
+ @function bc-util-list-join($list, $separator, $slice-start: 1, $slice-end: 0) {
2
+ $result: "";
3
+
4
+ @if type-of($list) == list {
5
+ $length: length($list);
6
+
7
+ @if $slice-end == false {
8
+ $slice-end: length($list);
9
+ }
10
+
11
+ @if $slice-start < 0 {
12
+ $slice-start: length($list) + $slice-start + 1;
13
+ }
14
+
15
+ @if $slice-end < 0 {
16
+ $slice-end: length($list) + $slice-end + 1;
17
+ }
18
+
19
+ @for $i from $slice-start through $length - $slice-end {
20
+ @if $result == "" {
21
+ $result: nth($list, $i);
22
+ }
23
+
24
+ @else {
25
+ $result: $result + "#{$separator}" + nth($list, $i);
26
+ }
27
+ }
28
+ }
29
+
30
+ @else {
31
+ $result: $list;
32
+ }
33
+
34
+ @return $result;
35
+ }
@@ -0,0 +1,15 @@
1
+ @function bc-util-power($x, $n) {
2
+ $ret: 1;
3
+
4
+ @if $n >= 0 {
5
+ @for $i from 1 through $n {
6
+ $ret: $ret * $x;
7
+ }
8
+ } @else {
9
+ @for $i from $n to 0 {
10
+ $ret: $ret / $x;
11
+ }
12
+ }
13
+
14
+ @return $ret;
15
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "bootcamp",
3
+ "version": "1.1.7",
4
+ "description": "A pure Sass testing framework in the style of Jasmine",
5
+ "keywords": [
6
+ "bootcamp",
7
+ "sass",
8
+ "scss",
9
+ "test",
10
+ "jasmine",
11
+ "gruntplugin",
12
+ "bower"
13
+ ],
14
+ "homepage": "https://github.com/thejameskyle/bootcamp",
15
+ "bugs": "https://github.com/thejameskyle/bootcamp/issues",
16
+ "author": {
17
+ "name": "James Kyle",
18
+ "email": "me@thejameskyle.com",
19
+ "url": "https://github.com/thejameskyle"
20
+ },
21
+ "contributors": [
22
+ {
23
+ "name": "James Kyle",
24
+ "email": "me@thejameskyle.com",
25
+ "url": "https://github.com/thejameskyle"
26
+ }
27
+ ],
28
+ "main": "dist/bootcamp.coffee",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git://github.com/thejameskyle/bootcamp.git"
32
+ },
33
+ "scripts": {
34
+ "test": "grunt test"
35
+ },
36
+ "files": [
37
+ "dist/",
38
+ "tasks/"
39
+ ],
40
+ "bin": {},
41
+ "dependencies": {
42
+ "colors": "^0.6.2"
43
+ },
44
+ "devDependencies": {
45
+ "grunt": "^0.4.5",
46
+ "grunt-contrib-sass": "^0.8.0",
47
+ "grunt-contrib-watch": "^0.6.1"
48
+ },
49
+ "peerDependencies": {
50
+ "grunt": "^0.4.5",
51
+ "grunt-contrib-sass": "^0.8.0"
52
+ },
53
+ "engines": {
54
+ "node": ">=0.8.0",
55
+ "npm": ">=1.2.10"
56
+ },
57
+ "licenses": [
58
+ {
59
+ "type": "MIT",
60
+ "url": "https://github.com/thejameskyle/bootcamp/blob/master/LICENSE.md"
61
+ }
62
+ ]
63
+ }
@@ -0,0 +1,83 @@
1
+ 'use strict'
2
+
3
+ bootcamp = require '../dist/bootcamp.coffee'
4
+ colors = require 'colors'
5
+
6
+ module.exports = (grunt) ->
7
+
8
+ grunt.registerMultiTask 'bootcamp', 'Jasmine-style BDD testing written in Sass for Sass.', ->
9
+
10
+ class bootcamp.gruntTask
11
+ constructor: (@tests) ->
12
+ if @tests.incomplete
13
+ @isIncomplete()
14
+ else if @tests.success and @tests.test == 0
15
+ @isEmpty
16
+ else if @tests.success
17
+ @hasPassed()
18
+ else
19
+ @hasFailed()
20
+
21
+ log: (string) -> grunt.log.writeln string
22
+ pass: (string) -> grunt.log.success string
23
+ warn: (string) -> grunt.log.warn string
24
+ fail: (string) -> grunt.fail.warn string
25
+
26
+ logStats: ->
27
+ stats = @tests.stats + ''
28
+ stats = stats.replace /✔/g, '✔'.green
29
+ stats = stats.replace /✗/g, '✗'.red
30
+ @log stats
31
+
32
+ logSpecs: ->
33
+ specs = @tests.specs + ''
34
+ specs = specs.replace /✔/g, '✔'.green
35
+ specs = specs.replace /✗/g, '✗'.red
36
+ specs = specs.replace /Test Passed/g, 'Test passed'.green
37
+ specs = specs.replace /Test Failed/g, 'Test failed'.red
38
+ specs = specs.replace /!(.*)!(.*)\./g, '$1:$2.'.yellow
39
+ specs = specs.trim()
40
+ if specs != ''
41
+ @log '\n' + specs + '\n'
42
+
43
+ logErrors: ->
44
+ if !@tests.errors then return null
45
+ @log ''
46
+
47
+ for error in @tests.errors
48
+ error = error + ''
49
+ error = error.replace /!(.*)!(.*)/g, '$1:'.red + '$2'.yellow
50
+ @log error.yellow
51
+
52
+ isIncomplete: ->
53
+ @fail @tests.error.yellow
54
+ return true
55
+
56
+ isEmpty: ->
57
+ @logStats()
58
+ @warn 'Your tests probably haven\'t been properly set up.\nTake a look at https://github.com/thejameskyle/bootcamp/wiki/setup'
59
+ return true
60
+
61
+ hasFailed: ->
62
+ @logSpecs()
63
+ @logStats()
64
+ @fail @tests.details
65
+ @logErrors()
66
+ return false
67
+
68
+ hasPassed: ->
69
+ @logSpecs()
70
+ @logStats()
71
+ @pass @tests.details
72
+ @logErrors()
73
+ return true
74
+
75
+ @files.forEach (f) ->
76
+ f.src.filter (filepath) ->
77
+
78
+ unless grunt.file.exists filepath
79
+ grunt.log.warn 'Source file "' + filepath + '" not found.'
80
+ return false
81
+
82
+ else
83
+ new bootcamp.gruntTask bootcamp.test filepath
@@ -0,0 +1,10 @@
1
+ @include describe("Actual") {
2
+ @include it("should return the actual value") {
3
+ $expect: expect(1);
4
+ @include should( expect( actual() ), to( be( 1 )));
5
+
6
+ $expect: expect( false );
7
+ $expect: expect("hello");
8
+ @include should( expect( actual() ), to( be( "hello" )));
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ @include describe("Expect") {
2
+ @include it("should expect something simple") {
3
+ @include should( expect( 1 ), to( be( 1 )));
4
+ @include should( expect( a ), to( be( a )));
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ @include describe("Not to") {
2
+ @include it("should expect not to do something simple") {
3
+ @include should(expect(1), not-to(be(2)));
4
+ }
5
+ }
@@ -0,0 +1,10 @@
1
+ @include describe("Should") {
2
+ @include it("should set the text and value") {
3
+ $when: should("be the correct", "value", true);
4
+ $text: $bc-expect-text;
5
+ $value: $bc-expect;
6
+
7
+ @include should( expect( $text ), to( be("be the correct")));
8
+ @include should( expect( $value ), to( be("value")));
9
+ }
10
+ }
@@ -0,0 +1,5 @@
1
+ @include describe("To") {
2
+ @include it("should expect to do something simple") {
3
+ @include should(expect(1), to(be(1)));
4
+ }
5
+ }
@@ -0,0 +1,11 @@
1
+ @include describe("Describe") {
2
+ @include it("should describe a module") {
3
+ @include should(null, true);
4
+ }
5
+
6
+ @include describe("Describe") {
7
+ @include it("should describe a sub-module") {
8
+ @include should(null, true);
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ @include describe("It") {
2
+ @include it("should create a new test") {
3
+ @include should(null, true);
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ @include describe("Should") {
2
+ @include it("should run a test") {
3
+ @include should(null, true);
4
+ }
5
+ }
@@ -0,0 +1,28 @@
1
+ $test: true;
2
+
3
+ @include xdescribe("xDescribe") {
4
+ @include it("shouldnt run") {
5
+ $test: false;
6
+ @include should(null, $test);
7
+ }
8
+
9
+ @include describe("normal submodule") {
10
+ @include it("shouldnt run sub-modules") {
11
+ $test: false;
12
+ @include should(null, $test);
13
+ }
14
+ }
15
+ }
16
+
17
+ @include describe("xDescribe") {
18
+ @include xdescribe("Submodule") {
19
+ @include it("shouldnt run sub-modules") {
20
+ $test: false;
21
+ @include should(null, $test);
22
+ }
23
+ }
24
+
25
+ @include it("should run after xdescribed sub-modules") {
26
+ @include should(null, $test);
27
+ }
28
+ }
@@ -0,0 +1,12 @@
1
+ $test: true;
2
+
3
+ @include describe("xIt") {
4
+ @include xit("shouldnt run a test") {
5
+ $test: false;
6
+ @include should(null, $test);
7
+ }
8
+
9
+ @include it("should run a later test") {
10
+ @include should(null, $test);
11
+ }
12
+ }
@@ -0,0 +1,90 @@
1
+ @include describe("be") {
2
+ @include it("should expect to be something") {
3
+ @include should( expect( 1 ), to( be( 1 )));
4
+ @include should( expect( a ), to( be( a )));
5
+ @include should( expect( true ), to( be( true )));
6
+ @include should( expect( false ), to( be( false )));
7
+ @include should( expect( null ), to( be( null )));
8
+ }
9
+
10
+ @include it("should expect not to be something") {
11
+ @include should( expect( 1 ), not-to( be( 2 )));
12
+ @include should( expect( a ), not-to( be( b )));
13
+ @include should( expect( true ), not-to( be( false )));
14
+ @include should( expect( false ), not-to( be( true )));
15
+ @include should( expect( null ), not-to( be( valid )));
16
+ }
17
+
18
+ @include it("should expect two equal values to be equal") {
19
+ @include should( expect( 1 ), to( be( 1 )));
20
+ @include should( expect( -1 ), to( be( -1 )));
21
+ @include should( expect( a ), to( be( a )));
22
+ @include should( expect( false ), to( be( false )));
23
+ }
24
+
25
+ @include it("should expect two non-equal values not to be equal") {
26
+ @include should( expect( 1 ), not-to( be( 2 )));
27
+ @include should( expect( -1 ), not-to( be( 1 )));
28
+ @include should( expect( a ), not-to( be( b )));
29
+ @include should( expect( false ), not-to( be( true )));
30
+ }
31
+
32
+ @include it("should expect two equal lists to be equal") {
33
+ @include should(expect( (1, 2, 3) ), to( be( (1, 2, 3) )));
34
+ @include should(expect( ("a", "b", "c") ), to( be( ("a", "b", "c") )));
35
+ @include should(expect( (true, false, true) ), to( be( (true, false, true) )));
36
+ }
37
+
38
+ @include it("should expect two unequal lists not to be equal") {
39
+ @include should(expect( (3, 2, 1) ), not-to( be( (1, 2, 3) )));
40
+ @include should(expect( ("c", "b", "a") ), not-to( be( ("a", "b", "c") )));
41
+ @include should(expect( (false, true, false) ), not-to( be( (true, false, true) )));
42
+ }
43
+
44
+ @include it("should expect two equal lists with different seperators to be equal") {
45
+ @include should(expect( 1 2 3 ), to( be( (1, 2, 3) )));
46
+ @include should(expect( "a" "b" "c" ), to( be( ("a", "b", "c") )));
47
+ @include should(expect( true false true ), to( be( (true, false, true) )));
48
+ }
49
+
50
+ @include it("should expect two equal lists built up programmatically to be equal") {
51
+ $numbers: 1, 2, 3;
52
+ $strings: "a", "b", "c";
53
+ $booleans: true, false, true;
54
+
55
+ $numbers-out: ();
56
+ $strings-out: ();
57
+ $booleans-out: ();
58
+
59
+ @for $i from 1 through 3 {
60
+ $numbers-out: append($numbers-out, nth($numbers, $i), comma);
61
+ $strings-out: append($strings-out, nth($strings, $i), comma);
62
+ $booleans-out: append($booleans-out, nth($booleans, $i), comma);
63
+ }
64
+
65
+ @include should(expect($numbers-out ), to( be( (1, 2, 3) )));
66
+ @include should(expect($strings-out ), to( be( ("a", "b", "c") )));
67
+ @include should(expect($booleans-out), to( be( (true, false, true) )));
68
+ }
69
+
70
+ @include it("should expect two unequal lists built up programmatically not to be equal") {
71
+ $numbers: 1, 2, 3;
72
+ $strings: "a", "b", "c";
73
+ $booleans: true, false, true;
74
+
75
+ $numbers-out: ();
76
+ $strings-out: ();
77
+ $booleans-out: ();
78
+
79
+ @for $i from 1 through 3 {
80
+ $numbers-out: append($numbers-out, nth($numbers, $i), comma);
81
+ $strings-out: append($strings-out, nth($strings, $i), comma);
82
+ $booleans-out: append($booleans-out, nth($booleans, $i), comma);
83
+ }
84
+
85
+ @include should(expect($numbers-out ), not-to( be( (3, 2, 1) )));
86
+ @include should(expect($strings-out ), not-to( be( ("c", "b", "a") )));
87
+ @include should(expect($booleans-out), not-to( be( (false, true, false) )));
88
+ }
89
+ }
90
+
@@ -0,0 +1,33 @@
1
+ @include describe("Equal") {
2
+ @include it("should expect two equal values to be equal") {
3
+ @include should( expect( 1 ), to( equal( 1 )));
4
+ @include should( expect( -1 ), to( equal( -1 )));
5
+ @include should( expect( a ), to( equal( a )));
6
+ @include should( expect( false ), to( equal( false )));
7
+ }
8
+
9
+ @include it("should expect two non-equal values not to be equal") {
10
+ @include should( expect( 1 ), not-to( equal( 2 )));
11
+ @include should( expect( -1 ), not-to( equal( 1 )));
12
+ @include should( expect( a ), not-to( equal( b )));
13
+ @include should( expect( false ), not-to( equal( true )));
14
+ }
15
+
16
+ @include it("should expect two equal lists to be equal") {
17
+ @include should(expect( (1, 2, 3) ), to( equal( (1, 2, 3) )));
18
+ @include should(expect( ("a", "b", "c") ), to( equal( ("a", "b", "c") )));
19
+ @include should(expect( (true, false, true) ), to( equal( (true, false, true) )));
20
+ }
21
+
22
+ @include it("should expect two unequal lists not to be equal") {
23
+ @include should(expect( (3, 2, 1) ), not-to( equal( (1, 2, 3) )));
24
+ @include should(expect( ("c", "b", "a") ), not-to( equal( ("a", "b", "c") )));
25
+ @include should(expect( (false, true, false) ), not-to( equal( (true, false, true) )));
26
+ }
27
+
28
+ @include it("should expect two equal lists with different seperators not to be equal") {
29
+ @include should(expect( 1 2 3 ), not-to( equal( (1, 2, 3) )));
30
+ @include should(expect( "a" "b" "c" ), not-to( equal( ("a", "b", "c") )));
31
+ @include should(expect( true false true ), not-to( equal( (true, false, true) )));
32
+ }
33
+ }
@@ -0,0 +1,12 @@
1
+ @include describe("Be empty") {
2
+ @include it("should expect lists without content to be empty") {
3
+ @include should( expect( () ), to( be-empty()));
4
+ }
5
+
6
+ @include it("should expect lists with content to not be empty") {
7
+ @include should( expect( 1 ), not-to( be-empty()));
8
+ @include should( expect( (1, 2, 3) ), not-to( be-empty()));
9
+ @include should( expect( null ), not-to( be-empty()));
10
+ @include should( expect( "string" ), not-to( be-empty()));
11
+ }
12
+ }