diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2015-08-26 04:59:48 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2015-08-26 04:59:48 +0300 |
commit | 72a53828fac5f025848b62594c257fadcf24fb0c (patch) | |
tree | b4cffd4b97c20a940275c745f29ce07a625f0497 /test | |
parent | 5091bc672da48b7f45b6daa0270752844ddd5da7 (diff) |
Remove obsolete files, s/bootstrap-sass/bootstrap
Diffstat (limited to 'test')
-rw-r--r-- | test/compass_test.rb | 2 | ||||
-rw-r--r-- | test/compilation_test.rb | 18 | ||||
-rw-r--r-- | test/dummy_node_mincer/apple-touch-icon-144-precomposed.png | bin | 3549 -> 0 bytes | |||
-rw-r--r-- | test/dummy_node_mincer/application.css.ejs.scss | 5 | ||||
-rw-r--r-- | test/dummy_node_mincer/manifest.js | 87 | ||||
-rw-r--r-- | test/dummy_rails/app/views/layouts/application.html.erb | 2 | ||||
-rw-r--r-- | test/dummy_rails/app/views/pages/root.html.slim | 2 | ||||
-rw-r--r-- | test/dummy_rails/config/application.rb | 6 | ||||
-rw-r--r-- | test/dummy_sass_only/Gemfile | 4 | ||||
-rw-r--r-- | test/dummy_sass_only/compile.rb | 13 | ||||
-rw-r--r-- | test/dummy_sass_only/import_all.sass | 1 | ||||
-rw-r--r-- | test/node_mincer_test.rb | 23 | ||||
-rw-r--r-- | test/node_sass_compile_test.sh | 10 | ||||
-rw-r--r-- | test/sass_test.rb | 27 | ||||
-rw-r--r-- | test/sprockets_rails_test.rb | 27 |
15 files changed, 6 insertions, 221 deletions
diff --git a/test/compass_test.rb b/test/compass_test.rb index 1811ca2..6a5123d 100644 --- a/test/compass_test.rb +++ b/test/compass_test.rb @@ -2,7 +2,7 @@ require 'test_helper' class CompassTest < Minitest::Test def test_create_project - command = 'rm -rf tmp/new-compass-project; bundle exec compass create tmp/new-compass-project -r bootstrap-sass --using bootstrap --trace --force' + command = 'rm -rf tmp/new-compass-project; bundle exec compass create tmp/new-compass-project -r bootstrap --trace --force' success = silence_stdout_if(!ENV['VERBOSE']) { system(command) } assert success, 'Compass project creation failed!' end diff --git a/test/compilation_test.rb b/test/compilation_test.rb deleted file mode 100644 index 8ff0e14..0000000 --- a/test/compilation_test.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'test_helper' -require 'fileutils' -require 'sass' - -class CompilationTest < Minitest::Test - def test_compilation - path = 'assets/stylesheets' - %w(_bootstrap _bootstrap-flex _bootstrap-grid _bootstrap-reboot).each do |file| - FileUtils.rm_rf('.sass-cache', secure: true) - engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path]) - FileUtils.mkdir_p("tmp/#{File.dirname(file)}") - File.open("tmp/#{file}.css", 'w') { |f| - f.write engine.render - } - assert true # nothing was raised - end - end -end diff --git a/test/dummy_node_mincer/apple-touch-icon-144-precomposed.png b/test/dummy_node_mincer/apple-touch-icon-144-precomposed.png Binary files differdeleted file mode 100644 index 622a865..0000000 --- a/test/dummy_node_mincer/apple-touch-icon-144-precomposed.png +++ /dev/null diff --git a/test/dummy_node_mincer/application.css.ejs.scss b/test/dummy_node_mincer/application.css.ejs.scss deleted file mode 100644 index 6b3235a..0000000 --- a/test/dummy_node_mincer/application.css.ejs.scss +++ /dev/null @@ -1,5 +0,0 @@ -@import "bootstrap"; - -#image-retina { - @include img-retina("apple-touch-icon-144-precomposed.png", "apple-touch-icon-144-precomposed.png", 72px, 72px); -} diff --git a/test/dummy_node_mincer/manifest.js b/test/dummy_node_mincer/manifest.js deleted file mode 100644 index 7935b97..0000000 --- a/test/dummy_node_mincer/manifest.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - - -// Build script from https://github.com/nodeca/mincer/tree/master/examples - -// -// Require module -// - - -var Mincer = require('mincer'); - - -// -// Get Mincer environment -// - - -// -// Configure Mincers logger, by default, all -// messages are going to the middle of nowhere -// - - -Mincer.logger.use(console); - - -// -// Create and export environment -// - - -var environment = new Mincer.Environment(process.cwd()); - - -// -// Configure environment load paths (where to find ssets) -// - -// Include bootstrap scss load path -var bootstrapPath = '../../'; -environment.appendPath(bootstrapPath + 'assets/stylesheets'); - -// Include fonts load path -environment.appendPath(bootstrapPath + 'assets/fonts'); - -// Include dir with assets, root just for test -environment.appendPath('./'); - - -// -// Define environment essential *_path helper that will be available in the -// processed assets. See `assets/stylesheets/app.css.ejs` for example. -// - - -environment.ContextClass.defineAssetPath(function (pathname, options) { - var asset = this.environment.findAsset(pathname, options); - - if (!asset) { - throw new Error("File " + pathname + " not found"); - } - - return '/assets/' + asset.digestPath; -}); - - -// -// Create and compile Manifest -// - -var manifest_path = process.argv[2] || __dirname + '/assets'; - -var manifest = new Mincer.Manifest(environment, manifest_path); - - -manifest.compile(['application.css'], function (err, assetsData) { - if (err) { - console.error("Failed compile assets: " + (err.message || err.toString())); - process.exit(128); - } - - console.info('\n\nAssets were successfully compiled.\n' + - 'Manifest data (a proper JSON) was written to:\n' + - manifest.path + '\n\n'); - console.dir(assetsData); -}); diff --git a/test/dummy_rails/app/views/layouts/application.html.erb b/test/dummy_rails/app/views/layouts/application.html.erb index 7ce6339..4252061 100644 --- a/test/dummy_rails/app/views/layouts/application.html.erb +++ b/test/dummy_rails/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> - <title>bootstrap-sass Dummy App</title> + <title>bootstrap Dummy App</title> <%= stylesheet_link_tag 'application', media: "all", 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> diff --git a/test/dummy_rails/app/views/pages/root.html.slim b/test/dummy_rails/app/views/pages/root.html.slim index bc04d74..7a9dc59 100644 --- a/test/dummy_rails/app/views/pages/root.html.slim +++ b/test/dummy_rails/app/views/pages/root.html.slim @@ -1,7 +1,7 @@ .navbar.navbar-dark.bg-inverse: .container-fluid button.navbar-toggler.hidden-sm-up type="button" data-toggle="collapse" data-target="#c1" ☰ .collapse.navbar-toggleable-xs#c1 - a.navbar-brand href="#" Bootstrap for Sass Test Rails App + a.navbar-brand href="#" Bootstrap Test Rails App ul.nav.navbar-nav li.nav-item.active: a.nav-link href="#" ' Home diff --git a/test/dummy_rails/config/application.rb b/test/dummy_rails/config/application.rb index e990bdd..8efdd98 100644 --- a/test/dummy_rails/config/application.rb +++ b/test/dummy_rails/config/application.rb @@ -10,10 +10,10 @@ require 'rails' require "#{framework}/railtie" end -require 'slim-rails' -require 'jquery-rails' +require 'bootstrap' require 'compass' -require 'bootstrap-sass' +require 'jquery-rails' +require 'slim-rails' require 'uglifier' module Dummy diff --git a/test/dummy_sass_only/Gemfile b/test/dummy_sass_only/Gemfile deleted file mode 100644 index bfde6fa..0000000 --- a/test/dummy_sass_only/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'https://rubygems.org' - -gem 'sass', '~> 3.3' -gem 'bootstrap-sass', path: '../..' diff --git a/test/dummy_sass_only/compile.rb b/test/dummy_sass_only/compile.rb deleted file mode 100644 index 09e6785..0000000 --- a/test/dummy_sass_only/compile.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'sass' -require 'bootstrap-sass' -require 'fileutils' - -scss_path = File.expand_path('./import_all.sass', File.dirname(__FILE__)) -css = Sass.compile File.read(scss_path), syntax: 'sass' - -if ARGV[0] - FileUtils.mkdir_p File.dirname(ARGV[0]) - File.open(ARGV[0], 'w') { |f| f.write css } -else - puts css -end diff --git a/test/dummy_sass_only/import_all.sass b/test/dummy_sass_only/import_all.sass deleted file mode 100644 index d57392f..0000000 --- a/test/dummy_sass_only/import_all.sass +++ /dev/null @@ -1 +0,0 @@ -@import 'bootstrap' diff --git a/test/node_mincer_test.rb b/test/node_mincer_test.rb deleted file mode 100644 index a0c70e6..0000000 --- a/test/node_mincer_test.rb +++ /dev/null @@ -1,23 +0,0 @@ -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/node_sass_compile_test.sh b/test/node_sass_compile_test.sh deleted file mode 100644 index 42422c1..0000000 --- a/test/node_sass_compile_test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Test compilation with node-sass binary - -mkdir -p tmp/node-sass -node-sass assets/stylesheets/_bootstrap.scss -o tmp/node-sass/ && \ -node-sass assets/stylesheets/_bootstrap-flex.scss -o tmp/node-sass/ && \ -node-sass assets/stylesheets/_bootstrap-grid.scss -o tmp/node-sass/ && \ -node-sass assets/stylesheets/_bootstrap-reboot.scss -o tmp/node-sass/ || \ -(echo "node-sass compilation failed" && exit 1) diff --git a/test/sass_test.rb b/test/sass_test.rb deleted file mode 100644 index 469c85f..0000000 --- a/test/sass_test.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'test_helper' -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/] - %x[bundle] - end - css_path = File.join GEM_PATH, 'tmp/bootstrap-sass-only.css' - command = "bundle exec ruby compile.rb #{Shellwords.escape css_path}" - success = Dir.chdir DUMMY_PATH do - silence_stdout_if !ENV['VERBOSE'] do - system(command) - end - end - assert success, 'Sass-only compilation failed' - @css = File.read(css_path) - end -end diff --git a/test/sprockets_rails_test.rb b/test/sprockets_rails_test.rb deleted file mode 100644 index 38707ca..0000000 --- a/test/sprockets_rails_test.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'test_helper' -require 'fileutils' -require 'find' -require 'shellwords' - -class SprocketsRailsTest < Minitest::Test - - def test_sprockets_digest_asset_refs - root = 'test/dummy_rails' - command = "bundle exec rake assets:precompile GEMFILE=#{GEM_PATH}/Gemfile RAILS_ENV=production" - compiled = Dir.chdir root do - silence_stderr_if !ENV['VERBOSE'] do - system(command) - end - end - assert compiled, 'Could not precompile assets' - Dir.glob(File.join(root, 'public', 'assets', 'app*.{css,js}')) do |path| - File.open(path, 'r') do |f| - f.read.scan /url\("?[^"]+\.(?:jpg|png|eot|woff2?|ttf|svg)[^"]*"?\)/ do |m| - assert_match /-[0-9a-f]{12,}\./, m - end - end - end - ensure - FileUtils.rm_rf %W(#{root}/public/assets/ #{root}/tmp/cache/), secure: true - end -end |