File: shared_extension_paths_test.rb

package info (click to toggle)
ruby-compass 1.0.3~dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,184 kB
  • ctags: 1,789
  • sloc: ruby: 12,904; makefile: 100; perl: 43; xml: 14; sh: 4
file content (36 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'test_helper'

class SharedExtensionsTest < Test::Unit::TestCase

  def setup
    Compass.reset_configuration!
    Compass.instance_variable_set("@shared_extension_paths", nil)
    @original_home = ENV["HOME"]
  end

  def teardown
    ENV["HOME"] = @original_home
    Compass.reset_configuration!
  end

  def test_shared_extension_paths_with_valid_home
    ENV["HOME"] = "/"
    assert_equal ["/.compass/extensions"], Compass.shared_extension_paths
  end

  def test_shared_extension_paths_with_nil_home
    ENV["HOME"] = nil
    assert_equal [], Compass.shared_extension_paths
  end

  def test_shared_extension_paths_with_file_home
    ENV["HOME"] = __FILE__
    assert_equal [], Compass.shared_extension_paths
  end

  def test_shared_extension_paths_with_relative_home
    ENV["HOME"] = "."
    assert_equal ["./.compass/extensions"], Compass.shared_extension_paths
  end

end