From 9aada6771176d191cd0f0095e656520591a39201 Mon Sep 17 00:00:00 2001 From: Geoff Kimball Date: Fri, 19 Dec 2014 15:09:17 -0800 Subject: [PATCH] Add unit tests for the two functions used in the exports mixin --- .gitignore | 2 +- scss/helpers/_functions.scss | 3 --- tests/unit/scss/tests.scss | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5356d7ab..90bdece1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,6 @@ bower_components/* node_modules/ npm-debug.log /dist/* -/.sass-cache/* +.sass-cache/ /build/* /tests/unit/scss/*.css* diff --git a/scss/helpers/_functions.scss b/scss/helpers/_functions.scss index 85380853..d6320b0e 100755 --- a/scss/helpers/_functions.scss +++ b/scss/helpers/_functions.scss @@ -1,4 +1,3 @@ -<<<<<<< HEAD // Foundation for Apps ALPHA // by ZURB // foundation.zurb.com @@ -46,10 +45,8 @@ $modules: () !default; @mixin exports($name) { // Check if the module has already been imported @if not imported($name) { - @debug "#{$name} has not yet been imported."; // Check if the module should be used @if using($name) { - @debug "#{$name} is being used."; $modules: append($modules, $name) !global; @content; } diff --git a/tests/unit/scss/tests.scss b/tests/unit/scss/tests.scss index 362db508..8d491a4f 100644 --- a/tests/unit/scss/tests.scss +++ b/tests/unit/scss/tests.scss @@ -4,6 +4,29 @@ @include runner-start; +@include describe("Using") { + @include it("should check if a module is in use") { + $include-css: ( + one: true, + two: false, + ) !global; + + @include should(expect(using(one)), to(be(true))); + @include should(expect(using(two)), to(be(false))); + } +} + +@include describe("Imported") { + @include it("should check if a module has already been imported") { + $modules: () !global; + + @include exports(test) {} + + @include should(expect(imported(test)), to(be(true))); + @include should(expect(imported(testTwo)), to(be(false))); + } +} + @include describe("Map Serialize") { @include it("should convert a Sass map into a JSON string") { $input: (