oulu-rails 0.5.7
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 +7 -0
- data/MIT-LICENSE +22 -0
- data/README.md +23 -0
- data/lib/oulu-rails/version.rb +3 -0
- data/lib/oulu-rails.rb +27 -0
- data/vendor/assets/javascripts/oulu/dev/positions-p.js.coffee +34 -0
- data/vendor/assets/javascripts/oulu/dev/positions-pp.js.coffee +57 -0
- data/vendor/assets/javascripts/oulu/dev/positions.js.coffee +6 -0
- data/vendor/assets/javascripts/oulu/helpers/js-autosize.js.coffee +2 -0
- data/vendor/assets/javascripts/oulu/helpers/js-checkbox.js.coffee +6 -0
- data/vendor/assets/javascripts/oulu/helpers/js-click-animate.js.coffee +8 -0
- data/vendor/assets/javascripts/oulu/helpers/js-delay-hidden.js.coffee +4 -0
- data/vendor/assets/javascripts/oulu/helpers/js-focused.js.coffee +7 -0
- data/vendor/assets/javascripts/oulu/helpers/js-hack.js.coffee +8 -0
- data/vendor/assets/javascripts/oulu/helpers/js-hide-after.j.coffee +5 -0
- data/vendor/assets/javascripts/oulu/helpers/js-hover-z-index.js.coffee +5 -0
- data/vendor/assets/javascripts/oulu/helpers/js-hovered.js.coffee +17 -0
- data/vendor/assets/javascripts/oulu/helpers/js-one-animate.js.coffee +5 -0
- data/vendor/assets/javascripts/oulu/helpers/js-open-children.js.coffee +28 -0
- data/vendor/assets/javascripts/oulu/helpers/js-open.js.coffee +51 -0
- data/vendor/assets/javascripts/oulu/helpers/js-scroll-to-top.js.coffee +11 -0
- data/vendor/assets/javascripts/oulu/helpers/js-scroll.js.coffee +9 -0
- data/vendor/assets/javascripts/oulu/helpers/js-side-slide.js.coffee +6 -0
- data/vendor/assets/javascripts/oulu/helpers/js-window-loading.js.coffee +15 -0
- data/vendor/assets/javascripts/oulu/helpers/js-window-sizes.js.coffee +6 -0
- data/vendor/assets/javascripts/oulu/helpers/open-close.js.coffee +23 -0
- data/vendor/assets/javascripts/oulu/ie/PIE_IE678.js +72 -0
- data/vendor/assets/javascripts/oulu/ie/PIE_IE9.js +46 -0
- data/vendor/assets/javascripts/oulu/ie/ie-selectors.js.coffee +3 -0
- data/vendor/assets/javascripts/oulu/ie/ie8-selectors.js.coffee +3 -0
- data/vendor/assets/javascripts/oulu/ie/ie9-selectors.js.coffee +6 -0
- data/vendor/assets/javascripts/oulu/ie/jquery.belatedPNG.min.js +29 -0
- data/vendor/assets/javascripts/oulu/ie/jquery.linkscubber.js +7 -0
- data/vendor/assets/javascripts/oulu/ie/svgeezy.min.js +12 -0
- data/vendor/assets/javascripts/oulu/plugins/check-box.js.coffee +34 -0
- data/vendor/assets/javascripts/oulu/plugins/footerFixed.js +74 -0
- data/vendor/assets/javascripts/oulu/plugins/jquery.autosize.min.js +7 -0
- data/vendor/assets/javascripts/oulu/plugins/jquery.cheat-code.js +63 -0
- data/vendor/assets/javascripts/oulu/plugins/jquery.css3form.js +195 -0
- data/vendor/assets/javascripts/oulu/plugins/jquery.depend.min.js +13 -0
- data/vendor/assets/javascripts/oulu/plugins/sns-buttons.js +339 -0
- data/vendor/assets/javascripts/oulu-ie8.js +6 -0
- data/vendor/assets/javascripts/oulu-ie9.js +2 -0
- data/vendor/assets/javascripts/oulu.js +2 -0
- data/vendor/assets/stylesheets/_oulu-base.css.sass +86 -0
- data/vendor/assets/stylesheets/_oulu.css.sass +13 -0
- data/vendor/assets/stylesheets/bootcamp/CHANGELOG.md +70 -0
- data/vendor/assets/stylesheets/bootcamp/CONTRIBUTING.md +72 -0
- data/vendor/assets/stylesheets/bootcamp/Gruntfile.coffee +34 -0
- data/vendor/assets/stylesheets/bootcamp/LICENSE.md +7 -0
- data/vendor/assets/stylesheets/bootcamp/README.md +52 -0
- data/vendor/assets/stylesheets/bootcamp/bower.json +15 -0
- data/vendor/assets/stylesheets/bootcamp/dist/_bootcamp.scss +46 -0
- data/vendor/assets/stylesheets/bootcamp/dist/bootcamp.coffee +101 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_actual.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_error.scss +29 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_expect.scss +6 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_not-to.scss +5 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_should.scss +6 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/functions/_to.scss +5 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_describe.scss +31 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_it.scss +31 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_runner.scss +28 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_should.scss +46 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_xdescribe.scss +9 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/mixins/_xit.scss +9 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/variables/_helpers.scss +5 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/variables/_settings.scss +2 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/variables/_should.scss +6 -0
- data/vendor/assets/stylesheets/bootcamp/dist/core/variables/_trackers.scss +6 -0
- data/vendor/assets/stylesheets/bootcamp/dist/lib/_sassyjson.scss +1075 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/_be.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/_equal.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_be-empty.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_be-longer-than.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_be-shorter-than.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_contain.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_deep-contain.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_deep-equal.scss +47 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/lists/_have-length-of.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-close-to.scss +12 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-greater-than.scss +12 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-less-than.scss +12 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/types/_be-falsy.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/types/_be-null.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/types/_be-truthy.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/matchers/types/_have-type-of.scss +3 -0
- data/vendor/assets/stylesheets/bootcamp/dist/utils/_contain.scss +15 -0
- data/vendor/assets/stylesheets/bootcamp/dist/utils/_equal.scss +23 -0
- data/vendor/assets/stylesheets/bootcamp/dist/utils/_list-join.scss +35 -0
- data/vendor/assets/stylesheets/bootcamp/dist/utils/_power.scss +15 -0
- data/vendor/assets/stylesheets/bootcamp/package.json +63 -0
- data/vendor/assets/stylesheets/bootcamp/tasks/bootcamp.coffee +83 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/functions/_actual.scss +10 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/functions/_expect.scss +6 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/functions/_not-to.scss +5 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/functions/_should.scss +10 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/functions/_to.scss +5 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_describe.scss +11 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_it.scss +5 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_should.scss +5 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_xdescribe.scss +28 -0
- data/vendor/assets/stylesheets/bootcamp/test/core/mixins/_xit.scss +12 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/_be.scss +90 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/_equal.scss +33 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_be-empty.scss +12 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_be-longer-than.scss +29 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_be-shorter-than.scss +29 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_contain.scss +39 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_deep-contain.scss +51 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_deep-equal.scss +151 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/lists/_have-length-of.scss +31 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/numbers/_be-close-to.scss +24 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/numbers/_be-greater-than.scss +16 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/numbers/_be-less-than.scss +16 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/types/_be-falsy.scss +14 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/types/_be-null.scss +13 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/types/_be-truthy.scss +13 -0
- data/vendor/assets/stylesheets/bootcamp/test/matchers/types/_have-type-of.scss +17 -0
- data/vendor/assets/stylesheets/bootcamp/test/specs.scss +45 -0
- data/vendor/assets/stylesheets/bootcamp/test/utils/_contain.scss +41 -0
- data/vendor/assets/stylesheets/bootcamp/test/utils/_equal.scss +79 -0
- data/vendor/assets/stylesheets/bootcamp/test/utils/_list-join.scss +39 -0
- data/vendor/assets/stylesheets/bootcamp/test/utils/_power.scss +13 -0
- data/vendor/assets/stylesheets/helper/_base-helper.css.sass +133 -0
- data/vendor/assets/stylesheets/helper/_click-actions.css.sass +188 -0
- data/vendor/assets/stylesheets/helper/_fade-actions.css.sass +30 -0
- data/vendor/assets/stylesheets/helper/_margin-padding.css.sass +16 -0
- data/vendor/assets/stylesheets/helper/_typoglaphy.css.sass +9 -0
- data/vendor/assets/stylesheets/options/amazlet/_amazlet.css.sass +32 -0
- data/vendor/assets/stylesheets/options/glitch/_glitch.css.sass +31 -0
- data/vendor/assets/stylesheets/options/oulu-buttons/_button-basic.css.sass +31 -0
- data/vendor/assets/stylesheets/options/web-fonts/_cousine.css.sass +12 -0
- data/vendor/assets/stylesheets/options/web-fonts/_font-awsome.css.sass +8 -0
- data/vendor/assets/stylesheets/options/web-fonts/_icomoon.css.sass +10 -0
- data/vendor/assets/stylesheets/options/web-fonts/_lato.css.sass +12 -0
- data/vendor/assets/stylesheets/options/web-fonts/_montserrat.css.sass +13 -0
- data/vendor/assets/stylesheets/options/web-fonts/_old-standard.css.sass +12 -0
- data/vendor/assets/stylesheets/options/web-fonts/_open-sans.css.sass +11 -0
- data/vendor/assets/stylesheets/options/web-fonts/_podkova.css.sass +12 -0
- data/vendor/assets/stylesheets/options/web-fonts/_pt-sans.css.sass +12 -0
- data/vendor/assets/stylesheets/options/web-fonts/_roboto.css.sass +11 -0
- data/vendor/assets/stylesheets/options/web-fonts/_satisfy.css.sass +13 -0
- data/vendor/assets/stylesheets/options/web-fonts/_source-code-pro.css.sass +13 -0
- data/vendor/assets/stylesheets/options/web-fonts/_source-sans-pro.css.sass +13 -0
- data/vendor/assets/stylesheets/options/web-fonts/_special-elite.css.sass +12 -0
- data/vendor/assets/stylesheets/options/web-fonts/_tauri.css.sass +11 -0
- data/vendor/assets/stylesheets/options/web-fonts/_ubuntu.css.sass +12 -0
- data/vendor/assets/stylesheets/settings/functions/_background.css.sass +60 -0
- data/vendor/assets/stylesheets/settings/functions/_bool.css.sass +5 -0
- data/vendor/assets/stylesheets/settings/functions/_border.css.sass +47 -0
- data/vendor/assets/stylesheets/settings/functions/_color.css.sass +65 -0
- data/vendor/assets/stylesheets/settings/functions/_content.css.sass +5 -0
- data/vendor/assets/stylesheets/settings/functions/_cursor.css.sass +5 -0
- data/vendor/assets/stylesheets/settings/functions/_direction.css.sass +8 -0
- data/vendor/assets/stylesheets/settings/functions/_image.css.sass +8 -0
- data/vendor/assets/stylesheets/settings/functions/_length.css.sass +20 -0
- data/vendor/assets/stylesheets/settings/functions/_list.css.sass +11 -0
- data/vendor/assets/stylesheets/settings/functions/_map.css.sass +5 -0
- data/vendor/assets/stylesheets/settings/functions/_number.css.sass +63 -0
- data/vendor/assets/stylesheets/settings/functions/_position.css.sass +47 -0
- data/vendor/assets/stylesheets/settings/functions/_reverse.css.sass +22 -0
- data/vendor/assets/stylesheets/settings/functions/_string.css.sass +5 -0
- data/vendor/assets/stylesheets/settings/functions/_text.css.sass +34 -0
- data/vendor/assets/stylesheets/settings/initializers/_reset.css.sass +85 -0
- data/vendor/assets/stylesheets/settings/mixins/_animation.css.sass +15 -0
- data/vendor/assets/stylesheets/settings/mixins/_background.css.sass +33 -0
- data/vendor/assets/stylesheets/settings/mixins/_balloon-tale.css.sass +111 -0
- data/vendor/assets/stylesheets/settings/mixins/_basic-font.css.sass +40 -0
- data/vendor/assets/stylesheets/settings/mixins/_block.css.sass +30 -0
- data/vendor/assets/stylesheets/settings/mixins/_border.css.sass +28 -0
- data/vendor/assets/stylesheets/settings/mixins/_button-base.css.sass +27 -0
- data/vendor/assets/stylesheets/settings/mixins/_clear-type.css.sass +4 -0
- data/vendor/assets/stylesheets/settings/mixins/_color.css.sass +9 -0
- data/vendor/assets/stylesheets/settings/mixins/_filters.css.sass +5 -0
- data/vendor/assets/stylesheets/settings/mixins/_form.css.sass +7 -0
- data/vendor/assets/stylesheets/settings/mixins/_grids.css.sass +149 -0
- data/vendor/assets/stylesheets/settings/mixins/_html5-input-types.scss +118 -0
- data/vendor/assets/stylesheets/settings/mixins/_ie-hacks.css.sass +8 -0
- data/vendor/assets/stylesheets/settings/mixins/_lines.css.sass +18 -0
- data/vendor/assets/stylesheets/settings/mixins/_link.css.sass +11 -0
- data/vendor/assets/stylesheets/settings/mixins/_list.css.sass +21 -0
- data/vendor/assets/stylesheets/settings/mixins/_margin-padding.css.sass +69 -0
- data/vendor/assets/stylesheets/settings/mixins/_overlay.css.sass +5 -0
- data/vendor/assets/stylesheets/settings/mixins/_positions.css.sass +28 -0
- data/vendor/assets/stylesheets/settings/mixins/_rem.css.sass +53 -0
- data/vendor/assets/stylesheets/settings/mixins/_resets.css.sass +17 -0
- data/vendor/assets/stylesheets/settings/mixins/_responsive-utilities.css.sass +160 -0
- data/vendor/assets/stylesheets/settings/mixins/_sassmatic.css.sass +172 -0
- data/vendor/assets/stylesheets/settings/mixins/_sprite-background.css.sass +18 -0
- data/vendor/assets/stylesheets/settings/mixins/_tables.css.sass +14 -0
- data/vendor/assets/stylesheets/settings/mixins/_text.css.sass +21 -0
- data/vendor/assets/stylesheets/settings/variables/_default.css.sass +69 -0
- metadata +362 -0
|
@@ -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,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,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,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,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,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,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
|
+
}
|