Sha256: 453c3a0ef22fb3404df47e2d90f2f4394dbd802706c4d9a9a1b11c0090abbf7f

Contents?: true

Size: 861 Bytes

Versions: 4

Compression:

Stored size: 861 Bytes

Contents

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

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

class TestContentProcessorScss < Test::Unit::TestCase

  include Test::WebgenAssertions

  def test_call
    obj = Webgen::ContentProcessor::Scss.new
    root = Webgen::Node.new(Webgen::Tree.new.dummy_root, '/', '/')
    node = Webgen::Node.new(root, 'test', 'test')
    context = Webgen::Context.new(:content => "#main {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.17 test/test_contentprocessor_scss.rb
webgen-0.5.15 test/test_contentprocessor_scss.rb
webgen-0.5.14 test/test_contentprocessor_scss.rb
webgen-0.5.13 test/test_contentprocessor_scss.rb