Sha256: efc85347a51165a50d9efe53ae3bfd1ae58865b07ddb17d4fbcba92450b65907

Contents?: true

Size: 862 Bytes

Versions: 4

Compression:

Stored size: 862 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'test/unit'
require 'helper'
require 'webgen/tree'
require 'webgen/contentprocessor'

class TestContentProcessorSass < Test::Unit::TestCase

  include Test::WebgenAssertions

  def test_call
    obj = Webgen::ContentProcessor::Sass.new
    root = Webgen::Node.new(Webgen::Tree.new.dummy_root, '/', '/')
    node = Webgen::Node.new(root, 'test', 'test')
    context = Webgen::Context.new(:content => "#main\n  :background-color #000",
                                                    :chain => [node])
    obj.call(context)
    assert_equal("#main {\n  background-color: #000; }\n", context.content)

    context.content = "#cont\n = 5"
    assert_error_on_line(Webgen::RenderError, 2) { obj.call(context) }

    def obj.require(lib); raise LoadError; end
    assert_raise(Webgen::LoadError) { obj.call(context) }
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
webgen-0.5.12 test/test_contentprocessor_sass.rb
webgen-0.5.11 test/test_contentprocessor_sass.rb
webgen-0.5.10 test/test_contentprocessor_sass.rb
webgen-0.5.9 test/test_contentprocessor_sass.rb