Sha256: 9ee33a5da1e9533efc705848cf645f19e58861291b6eb5752ed2364be984921e

Contents?: true

Size: 863 Bytes

Versions: 4

Compression:

Stored size: 863 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: black; }\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.17 test/test_contentprocessor_sass.rb
webgen-0.5.15 test/test_contentprocessor_sass.rb
webgen-0.5.14 test/test_contentprocessor_sass.rb
webgen-0.5.13 test/test_contentprocessor_sass.rb