Sha256: 261896815bf8ab5e65289ac116a333a433569bc09b134bb34b6ef42aefb1a3a1

Contents?: true

Size: 832 Bytes

Versions: 22

Compression:

Stored size: 832 Bytes

Contents

require "test_helper"

class TestCssDependencyResolver < Test::Unit::TestCase
  def setup
    @resolver = Juicer::CssDependencyResolver.new
    Juicer::Test::FileSetup.new.create
  end

  def test_init
    assert_equal [], @resolver.files
  end

  def test_resolve
    b_file = path('b.css')
    a_file = path('a.css')

    files = @resolver.resolve(path('a.css')) do |file|
      assert b_file == file || a_file == file
      b_file != file
    end

    assert_equal [a_file], files

    files = @resolver.resolve(path('a.css')) do |file|
      assert b_file == file || a_file == file
      true
    end

    assert_equal [a_file, b_file], files.sort
  end

  def test_load_order
    files = @resolver.resolve(path("a1.css")).collect { |file| file.split("/").pop }
    assert_equal "d1.cssb1.cssc1.cssa1.css", files.join
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
juicer-1.0.16 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.15 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.14 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.13 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
psyho_juicer-1.0.11 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.12 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.11 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.10 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
psyho_juicer-1.0.9 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.9 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.8 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.7 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
psyho_juicer-1.0.7 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.6 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.5 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.4 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.3 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.2 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
juicer-1.0.1 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
psyho_juicer-1.0.0 test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb