diff --git a/test/Gemfile b/test/Gemfile deleted file mode 100644 index 29d85c6d1..000000000 --- a/test/Gemfile +++ /dev/null @@ -1,12 +0,0 @@ -# Pull gems from RubyGems -source 'https://rubygems.org' - -gem 'sass', "~> 3.3" -gem 'compass', "~> 1.0" - -group :test do - gem 'rake' - gem "diffy", "~> 3.0.1" - gem "colorize", "~> 0.6.0" - gem 'minitest', "~> 5.6" -end diff --git a/test/README.md b/test/README.md deleted file mode 100644 index 9195271db..000000000 --- a/test/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Tests - -The tests for this project are built using Navigator, a Ruby testing framework -for Sass with Compass. https://github.com/Team-Sass/navigator - -## Building the test environment - -Navigator works through Ruby, so you need to be running Ruby 1.8.7 or greater, and you to install [Bundler](http://bundler.io/) with `gem install bundler` or, for Mac OS X and other systems requiring administrative privileges, `sudo gem install bundler`. - -Once Bundler is installed, change to the tests directory and run `bundle install` to install libraries required by this project. - -## Running tests - -Once you have everything installed, change to the tests directory and run `bundle exec rake` to run the tests. This will compile all of the files in your `tests/tests` files into CSS files and compare those files to the files in `tests/controls`. If any of your output file from your tests don't line up with your controls, you'll get a `.diff` file generated of the differences and you'll get a failed assertion. If your Sass won't compile, you'll get a failed assertion. - -If you're working off of a known set of good output and you'd like to generate your controls quickly, you can run `bundle exec rake compile`. diff --git a/test/Rakefile b/test/Rakefile deleted file mode 100644 index e1adcf045..000000000 --- a/test/Rakefile +++ /dev/null @@ -1,25 +0,0 @@ -# Navigator | Copyright 2013 Team Sass | MIT License | https://github.com/Team-Sass/navigator - -task :default => [:test] - -task :test do - require 'fileutils' - - output_dir = 'output' - FileUtils.mkdir_p output_dir - ruby 'unit_tests.rb' - FileUtils.rm_rf output_dir -end - -desc 'Compile baseline CSS' -task :compile do - require 'compass' - require 'compass/exec' - - Compass.add_configuration 'config.rb' - Compass.configuration.project_path = Dir.pwd - # Compile into baseline directory instead of test output directory - Compass.configuration.css_dir = 'controls' - Compass.compiler.clean! - Compass.compiler.run -end diff --git a/test/config.rb b/test/config.rb deleted file mode 100644 index f9906ceb8..000000000 --- a/test/config.rb +++ /dev/null @@ -1,22 +0,0 @@ -# Require any additional compass plugins here. - -# File system locations -sass_dir = 'tests' -css_dir = 'output' - -# If developing an extension, add your extension's stylesheets folder as an import path. -add_import_path '../sass/' - -# Set to true for easier debugging -line_comments = false -# preferred_syntax = :sass - -# CSS output style - :nested, :expanded, :compact, or :compressed -output_style = :expanded - -# Determine whether Compass asset helper functions generate relative -# or absolute paths -relative_assets = true - -# Learn more: -# http://compass-style.org/docs/tutorials/configuration-reference/ diff --git a/test/tests/font.scss b/test/fixtures/variables/font/input.scss similarity index 100% rename from test/tests/font.scss rename to test/fixtures/variables/font/input.scss diff --git a/test/controls/font.css b/test/fixtures/variables/font/output.css similarity index 100% rename from test/controls/font.css rename to test/fixtures/variables/font/output.css diff --git a/test/tests/indent-amount.scss b/test/fixtures/variables/indent-amount/input.scss similarity index 100% rename from test/tests/indent-amount.scss rename to test/fixtures/variables/indent-amount/input.scss diff --git a/test/controls/indent-amount.css b/test/fixtures/variables/indent-amount/output.css similarity index 100% rename from test/controls/indent-amount.css rename to test/fixtures/variables/indent-amount/output.css diff --git a/test/tests/strict-normalize-false.scss b/test/fixtures/variables/strict-normalize-false/input.scss similarity index 100% rename from test/tests/strict-normalize-false.scss rename to test/fixtures/variables/strict-normalize-false/input.scss diff --git a/test/controls/strict-normalize-false.css b/test/fixtures/variables/strict-normalize-false/output.css similarity index 100% rename from test/controls/strict-normalize-false.css rename to test/fixtures/variables/strict-normalize-false/output.css diff --git a/test/tests/strict-normalize-true.scss b/test/fixtures/variables/strict-normalize-true/input.scss similarity index 100% rename from test/tests/strict-normalize-true.scss rename to test/fixtures/variables/strict-normalize-true/input.scss diff --git a/test/controls/strict-normalize-true.css b/test/fixtures/variables/strict-normalize-true/output.css similarity index 100% rename from test/controls/strict-normalize-true.css rename to test/fixtures/variables/strict-normalize-true/output.css diff --git a/test/tests/ie10.scss b/test/fixtures/variables/support-for/ie10/input.scss similarity index 100% rename from test/tests/ie10.scss rename to test/fixtures/variables/support-for/ie10/input.scss diff --git a/test/controls/ie10.css b/test/fixtures/variables/support-for/ie10/output.css similarity index 100% rename from test/controls/ie10.css rename to test/fixtures/variables/support-for/ie10/output.css diff --git a/test/tests/ie11.scss b/test/fixtures/variables/support-for/ie11/input.scss similarity index 100% rename from test/tests/ie11.scss rename to test/fixtures/variables/support-for/ie11/input.scss diff --git a/test/controls/ie11.css b/test/fixtures/variables/support-for/ie11/output.css similarity index 100% rename from test/controls/ie11.css rename to test/fixtures/variables/support-for/ie11/output.css diff --git a/test/tests/ie6.scss b/test/fixtures/variables/support-for/ie6/input.scss similarity index 100% rename from test/tests/ie6.scss rename to test/fixtures/variables/support-for/ie6/input.scss diff --git a/test/controls/ie6.css b/test/fixtures/variables/support-for/ie6/output.css similarity index 100% rename from test/controls/ie6.css rename to test/fixtures/variables/support-for/ie6/output.css diff --git a/test/tests/ie7.scss b/test/fixtures/variables/support-for/ie7/input.scss similarity index 100% rename from test/tests/ie7.scss rename to test/fixtures/variables/support-for/ie7/input.scss diff --git a/test/controls/ie7.css b/test/fixtures/variables/support-for/ie7/output.css similarity index 100% rename from test/controls/ie7.css rename to test/fixtures/variables/support-for/ie7/output.css diff --git a/test/tests/ie8.scss b/test/fixtures/variables/support-for/ie8/input.scss similarity index 100% rename from test/tests/ie8.scss rename to test/fixtures/variables/support-for/ie8/input.scss diff --git a/test/controls/ie8.css b/test/fixtures/variables/support-for/ie8/output.css similarity index 100% rename from test/controls/ie8.css rename to test/fixtures/variables/support-for/ie8/output.css diff --git a/test/tests/ie9.scss b/test/fixtures/variables/support-for/ie9/input.scss similarity index 100% rename from test/tests/ie9.scss rename to test/fixtures/variables/support-for/ie9/input.scss diff --git a/test/controls/ie9.css b/test/fixtures/variables/support-for/ie9/output.css similarity index 100% rename from test/controls/ie9.css rename to test/fixtures/variables/support-for/ie9/output.css diff --git a/test/tests/safari6.scss b/test/fixtures/variables/support-for/safari6/input.scss similarity index 100% rename from test/tests/safari6.scss rename to test/fixtures/variables/support-for/safari6/input.scss diff --git a/test/controls/safari6.css b/test/fixtures/variables/support-for/safari6/output.css similarity index 100% rename from test/controls/safari6.css rename to test/fixtures/variables/support-for/safari6/output.css diff --git a/test/tests/safari7.scss b/test/fixtures/variables/support-for/safari7/input.scss similarity index 100% rename from test/tests/safari7.scss rename to test/fixtures/variables/support-for/safari7/input.scss diff --git a/test/controls/safari7.css b/test/fixtures/variables/support-for/safari7/output.css similarity index 100% rename from test/controls/safari7.css rename to test/fixtures/variables/support-for/safari7/output.css diff --git a/test/unit_tests.rb b/test/unit_tests.rb deleted file mode 100644 index e2e13f0a5..000000000 --- a/test/unit_tests.rb +++ /dev/null @@ -1,56 +0,0 @@ -# Navigator | Copyright 2013 Team Sass | MIT License | https://github.com/Team-Sass/navigator - -require 'compass' -require 'compass/exec' -require 'minitest/autorun' -require 'diffy' -require 'colorize' -require 'pathname' - -class TestCompassOutput < Minitest::Test - - Compass.add_configuration 'config.rb' - Compass.configuration.project_path = Dir.pwd - - # Remove all current Diff files - Dir.glob("#{Dir.pwd}/output/**/*.css.diff").each { |f| File.delete(f) } - - Compass.compiler.sass_files.each do |sass_file| - test_name = File.basename(sass_file, '.*') - - define_method "test_#{test_name}_compile " do - # Compiled CSS file path - css_file = Compass.compiler.corresponding_css_file(sass_file) - - # Relative path of compiled CSS file from Tests directory - css_file_relative = Pathname.new(css_file).relative_path_from(Pathname.new("#{Dir.pwd}/output")).to_s - - # Control files path - control_file = "#{Dir.pwd}/controls/" + css_file_relative - - # The base path of the sub folders, making the folders if needed - base_dir = File.dirname(css_file_relative) - FileUtils.mkdir_p "#{Dir.pwd}/output/#{base_dir}" - - # Compiles Sass file - Compass.compiler.compile sass_file, css_file # Raises exception upon error - - begin - # Assert that our test output matches our control output - passed = assert FileUtils.compare_file(css_file, control_file), "Compiled output for #{File.basename(sass_file)} does not match control output!".red - ensure - # If there is a failure, generate a diff of the files and put it with the compiled file - if !passed - test_file = File.open(css_file).read; - control_file = File.open(control_file).read; - diff_file = "#{css_file}.diff" - diff_content = Diffy::Diff.new(control_file, test_file, :include_diff_info => true) - - File.open(diff_file, 'w') { |f| f.write(diff_content.to_s(:text)) } - - puts "Control->Compiled diff output to ".yellow + "output/#{css_file_relative}.diff".blue - end - end - end - end -end