Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJan Stevens <jan@playpass.be>2015-08-20 12:36:40 +0300
committerJan Stevens <jan@playpass.be>2015-08-20 12:36:40 +0300
commit66e4af2ad8251ca945a9e2a1398bc8ce2f29bdf3 (patch)
tree40e2802206ccab030afcf0645e7de6737016f432 /test
parente66545f886d0bab97e2b6c63cebbd03b993cb2e3 (diff)
Renamed converter to updater since its an updater and does not convert anymore
Diffstat (limited to 'test')
-rw-r--r--test/dummy_node_mincer/application.css.ejs.scss1
-rw-r--r--test/node_mincer_test.rb23
-rw-r--r--test/sass_test.rb5
3 files changed, 28 insertions, 1 deletions
diff --git a/test/dummy_node_mincer/application.css.ejs.scss b/test/dummy_node_mincer/application.css.ejs.scss
index 4b1a0e0..6b3235a 100644
--- a/test/dummy_node_mincer/application.css.ejs.scss
+++ b/test/dummy_node_mincer/application.css.ejs.scss
@@ -1,4 +1,3 @@
-@import "bootstrap-mincer";
@import "bootstrap";
#image-retina {
diff --git a/test/node_mincer_test.rb b/test/node_mincer_test.rb
new file mode 100644
index 0000000..a0c70e6
--- /dev/null
+++ b/test/node_mincer_test.rb
@@ -0,0 +1,23 @@
+require 'test_helper'
+require 'json'
+
+class NodeMincerTest < Minitest::Test
+ DUMMY_PATH = 'test/dummy_node_mincer'
+
+ def test_image_helper
+ assert_match %r(url\(['"]?apple-touch-icon-144-precomposed.*png['"]?\)), @css
+ end
+
+ def setup
+ tmp_dir = File.join GEM_PATH, 'tmp/node-mincer'
+ success = Dir.chdir DUMMY_PATH do
+ silence_stdout_if !ENV['VERBOSE'] do
+ system 'node', 'manifest.js', tmp_dir
+ end
+ end
+ assert success, 'Node.js Mincer compilation failed'
+ manifest = JSON.parse(File.read("#{tmp_dir}/manifest.json"))
+ css_name = manifest['assets']['application.css']
+ @css = File.read("#{tmp_dir}/#{css_name}")
+ end
+end
diff --git a/test/sass_test.rb b/test/sass_test.rb
index 832ab65..469c85f 100644
--- a/test/sass_test.rb
+++ b/test/sass_test.rb
@@ -4,6 +4,11 @@ require 'shellwords'
class SassTest < Minitest::Test
DUMMY_PATH = 'test/dummy_sass_only'
+ # We check if the css includes a typical bootstrap class
+ def test_css_matcher
+ assert_match 'col-xs-1', @css
+ end
+
def setup
Dir.chdir DUMMY_PATH do
%x[rm -rf .sass-cache/]