spec.add_development_dependency 'benchmark_driver'
spec.add_development_dependency 'bundler'
- spec.add_development_dependency 'coffee-script'
spec.add_development_dependency 'erubi'
spec.add_development_dependency 'haml', '>= 5'
spec.add_development_dependency 'less'
+++ /dev/null
-describe Hamlit::Filters do
- include RenderHelper
-
- describe '#compile' do
- it 'renders coffee filter' do
- assert_render(<<-HTML.unindent, <<-HAML.unindent)
- <script>
- (function() {
- var foo;
-
- foo = function() {
- return alert('hello');
- };
-
- }).call(this);
- </script>
- HTML
- :coffee
- foo = ->
- alert('hello')
- HAML
- end
-
- it 'renders coffeescript filter' do
- assert_render(<<-HTML.unindent, <<-HAML.unindent)
- <script>
- (function() {
- var foo;
-
- foo = function() {
- return alert('hello');
- };
-
- }).call(this);
- </script>
- HTML
- :coffeescript
- foo = ->
- alert('hello')
- HAML
- end
-
- it 'renders coffeescript filter' do
- assert_render(<<-HTML.unindent, <<-'HAML'.unindent)
- <script>
- (function() {
- var foo;
-
- foo = function() {
- return alert("<&>");
- };
-
- }).call(this);
- </script>
- HTML
- :coffee
- foo = ->
- alert("#{'<&>'}")
- HAML
- end
- end unless /java/ === RUBY_PLATFORM # execjs is not working with Travis JRuby environment
-end
end
describe 'filters' do
- describe 'coffee filter' do
- it 'renders static filter' do
- assert_render(<<-HTML.unindent, <<-'HAML'.unindent)
- <script>
- (function() {
- jQuery(function($) {
- console.log('3');
- return console.log('4');
- });
-
- }).call(this);
- </script>
- 5
- HTML
- :coffee
- jQuery ($) ->
- console.log('#{__LINE__}')
- console.log('#{__LINE__}')
- = __LINE__
- HAML
- end
-
- it 'renders dynamic filter' do
- assert_render(<<-HTML.unindent, <<-HAML.unindent)
- <script>
- (function() {
- jQuery(function($) {
- console.log('3');
- return console.log('4');
- });
-
- }).call(this);
- </script>
- 5
- HTML
- :coffee
- jQuery ($) ->
- console.log('3')
- console.log('4')
- = __LINE__
- HAML
- end
- end unless /java/ === RUBY_PLATFORM # execjs is not working with Travis JRuby environment
-
describe 'css filter' do
it 'renders static filter' do
assert_render(<<-HTML.unindent, <<-HAML.unindent)