Sha256: bbb7b29f160408b2f89d2b863240262410b59b11c3bbd956f7cddf69e3b15437

Contents?: true

Size: 2 KB

Versions: 10

Compression:

Stored size: 2 KB

Contents

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(*%w(create --boring basic))
      assert File.exists?("basic/sass/screen.scss")
      assert_action_performed :directory, "basic/"
      assert_action_performed    :create, "basic/sass/screen.scss"
    end
  end

  Compass::Frameworks::ALL.each do |framework|
    next if framework.name == "true"
    next if framework.name == "testing"
    next if framework.name =~ /^_/
    define_method "test_#{framework.name}_installation" do
      within_tmp_directory do
        compass(*%W(create --boring --using #{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    :write, "#{framework.name}_project/stylesheets/screen.css"
      end
    end
  end

  def test_basic_update
    within_tmp_directory do
      compass "create", "--boring", "basic"
      Dir.chdir "basic" do
        # basic update with timestamp caching
        compass "compile", "--boring"
        # assert_action_performed :unchanged, "sass/screen.scss"
        # basic update with force option set
        compass "compile", "--force", "--boring"
        assert_action_performed :write, "stylesheets/screen.css"
      end
    end
  end

end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/compass-1.0.3/test/units/command_line_test.rb
compass-1.0.3 test/units/command_line_test.rb
compass-1.1.0.alpha.3 test/units/command_line_test.rb
compass-1.1.0.alpha.2 test/units/command_line_test.rb
compass-1.1.0.alpha.1 test/units/command_line_test.rb
compass-1.1.0.alpha.0 test/units/command_line_test.rb
compass-1.0.1 test/units/command_line_test.rb
compass-1.0.0 test/units/command_line_test.rb
compass-1.0.0.rc.1 test/units/command_line_test.rb
compass-1.0.0.rc.0 test/units/command_line_test.rb