compass/test/command_line_test.rb
Chris Eppstein b07f303d9b Merge branch 'stable'
* stable: (36 commits)
  Tweak the changelog.
  [CSS3] The box-shadow $spread value now defaults to using the browser default instead of 0.
  update the lockfile
  some todos
  Move the contributing guide to the tutorials section.
  add on-page anchors to the command line reference page.
  Better docs on the grid image command.
  Move the tutorials to the main nav... I don't think most people see it.
  Don't set the display in the box-flex mixin. This makes nested flex boxes annoying. Closes GH-207
  Add a note about the colorization change.
  Add a note about the compass validator
  Only colorize the action when logging results.
  Update to use the new compass validator during development.
  Fix broken test cases.
  Support true in addition to the inset keyword for the box-shadow mixin. Closes GH-206
  IE8 compat for :last-child selector
  Make the compass configuration file more self documenting by adding comments for preferred_syntax, output_style, and line_comments.
  Pass --no-line-comments to disable line comments.
  A little less noise during installation.
  Change the default Sass directory in standalone projects from src to sass. Closes GH-203
  ...

Conflicts:
	TODO.md
	VERSION.yml
	doc-src/content/CHANGELOG.markdown
	features/command_line.feature
	features/step_definitions/command_line_steps.rb
	lib/compass/commands/write_configuration.rb
2010-11-11 21:45:07 -08:00

61 lines
2.0 KiB
Ruby

require 'test_helper'
require 'fileutils'
require 'compass'
require 'compass/exec'
require 'timeout'
class CommandLineTest < Test::Unit::TestCase
include Compass::TestCaseHelper
include Compass::CommandLineHelper
include Compass::IoHelper
def teardown
Compass.reset_configuration!
end
def test_print_version
compass "-vq"
assert_match /\d+\.\d+\.(\d+|((alpha|beta|rc)\.\d+\.[0-9a-f]+))?/, @last_result
end
def test_basic_install
within_tmp_directory do
compass "--boring", "basic"
assert File.exists?("basic/sass/screen.scss")
assert File.exists?("basic/stylesheets/screen.css")
assert_action_performed :directory, "basic/"
assert_action_performed :create, "basic/sass/screen.scss"
assert_action_performed :create, "basic/stylesheets/screen.css"
end
end
Compass::Frameworks::ALL.each do |framework|
next if framework.name =~ /^_/
define_method "test_#{framework.name}_installation" do
within_tmp_directory do
compass *%W(--boring --framework #{framework.name} #{framework.name}_project)
assert File.exists?("#{framework.name}_project/sass/screen.scss"), "sass/screen.scss is missing. Found: #{Dir.glob("#{framework.name}_project/**/*").join(", ")}"
assert File.exists?("#{framework.name}_project/stylesheets/screen.css")
assert_action_performed :directory, "#{framework.name}_project/"
assert_action_performed :create, "#{framework.name}_project/sass/screen.scss"
assert_action_performed :create, "#{framework.name}_project/stylesheets/screen.css"
end
end
end
def test_basic_update
within_tmp_directory do
compass "--boring", "basic"
Dir.chdir "basic" do
# basic update with timestamp caching
compass "--boring"
assert_action_performed :unchanged, "sass/screen.scss"
# basic update with force option set
compass "--force", "--boring"
assert_action_performed :identical, "stylesheets/screen.css"
end
end
end
end