Sha256: 863351d25cb50b007db12bf583f553e2490968bd0a0d5deaa954d0111cfe8e05

Contents?: true

Size: 1.18 KB

Versions: 7

Compression:

Stored size: 1.18 KB

Contents

describe Hamlit::Filters::Coffee do
  describe '#compile' do
    it 'renders coffee filter' do
      assert_render(<<-HAML, <<-HTML)
        :coffee
          foo = ->
            alert('hello')
      HAML
        <script>
          (function() {
            var foo;
          
            foo = function() {
              return alert('hello');
            };
          
          }).call(this);
        </script>
      HTML
    end

    it 'renders coffeescript filter' do
      assert_render(<<-HAML, <<-HTML)
        :coffee
          foo = ->
            alert('hello')
      HAML
        <script>
          (function() {
            var foo;
          
            foo = function() {
              return alert('hello');
            };
          
          }).call(this);
        </script>
      HTML
    end

    it 'renders coffeescript filter' do
      assert_render(<<-'HAML', <<-HTML)
        :coffee
          foo = ->
            alert("#{'<&>'}")
      HAML
        <script>
          (function() {
            var foo;
          
            foo = function() {
              return alert("<&>");
            };
          
          }).call(this);
        </script>
      HTML
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hamlit-1.7.2 spec/hamlit/filters/coffee_spec.rb
hamlit-1.7.1 spec/hamlit/filters/coffee_spec.rb
hamlit-1.7.0 spec/hamlit/filters/coffee_spec.rb
hamlit-1.6.7 spec/hamlit/filters/coffee_spec.rb
hamlit-1.6.6 spec/hamlit/filters/coffee_spec.rb
hamlit-1.5.3 spec/hamlit/filters/coffee_spec.rb
hamlit-1.5.2 spec/hamlit/filters/coffee_spec.rb