Sha256: e30b238c9e1c1e7eb1099bb2775b0ff3eebaad0224dbca4bdabf7981a1b1e080

Contents?: true

Size: 1.37 KB

Versions: 33

Compression:

Stored size: 1.37 KB

Contents

require 'test_helper'
require 'tilt'

begin
  require 'tilt/sass'

  class SassTemplateTest < Minitest::Test
    test "is registered for '.sass' files" do
      assert_equal Tilt::SassTemplate, Tilt['test.sass']
    end

    test "compiles and evaluates the template on #render" do
      template = Tilt::SassTemplate.new { |t| "#main\n  :background-color #0000f1" }
      assert_equal "#main {\n  background-color: #0000f1; }\n", template.render
    end

    test "can be rendered more than once" do
      template = Tilt::SassTemplate.new { |t| "#main\n  :background-color #0000f1" }
      3.times { assert_equal "#main {\n  background-color: #0000f1; }\n", template.render }
    end
  end

  class ScssTemplateTest < Minitest::Test
    test "is registered for '.scss' files" do
      assert_equal Tilt::ScssTemplate, Tilt['test.scss']
    end

    test "compiles and evaluates the template on #render" do
      template = Tilt::ScssTemplate.new { |t| "#main {\n  background-color: #0000f1;\n}" }
      assert_equal "#main {\n  background-color: #0000f1; }\n", template.render
    end

    test "can be rendered more than once" do
      template = Tilt::ScssTemplate.new { |t| "#main {\n  background-color: #0000f1;\n}" }
      3.times { assert_equal "#main {\n  background-color: #0000f1; }\n", template.render }
    end
  end

rescue LoadError => boom
  warn "Tilt::SassTemplate (disabled)"
end

Version data entries

33 entries across 33 versions & 10 rubygems

Version Path
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
brakeman-3.4.1 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
brakeman-3.4.0 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
brakeman-3.3.5 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
brakeman-3.3.4 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
brakeman-3.3.3 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
brakeman-3.3.2 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
brakeman-3.3.1 bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_sasstemplate_test.rb
tilt-2.0.5 test/tilt_sasstemplate_test.rb