temple 0.8.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +34 -0
- data/.gitignore +1 -0
- data/CHANGES +25 -1
- data/Gemfile +0 -1
- data/README.md +1 -1
- data/Rakefile +4 -11
- data/lib/temple/erb/engine.rb +2 -0
- data/lib/temple/erb/parser.rb +1 -1
- data/lib/temple/filters/ambles.rb +21 -0
- data/lib/temple/filters/string_splitter.rb +12 -1
- data/lib/temple/generator.rb +1 -1
- data/lib/temple/generators/rails_output_buffer.rb +3 -4
- data/lib/temple/mixins/grammar_dsl.rb +2 -1
- data/lib/temple/templates/rails.rb +6 -2
- data/lib/temple/templates/tilt.rb +1 -9
- data/lib/temple/utils.rb +4 -15
- data/lib/temple/version.rb +1 -1
- data/lib/temple.rb +1 -0
- data/spec/engine_spec.rb +189 -0
- data/{test/test_erb.rb → spec/erb_spec.rb} +12 -12
- data/spec/filter_spec.rb +29 -0
- data/{test/filters/test_code_merger.rb → spec/filters/code_merger_spec.rb} +7 -7
- data/{test/filters/test_control_flow.rb → spec/filters/control_flow_spec.rb} +13 -13
- data/{test/filters/test_dynamic_inliner.rb → spec/filters/dynamic_inliner_spec.rb} +18 -18
- data/{test/filters/test_eraser.rb → spec/filters/eraser_spec.rb} +9 -9
- data/{test/filters/test_escapable.rb → spec/filters/escapable_spec.rb} +10 -10
- data/{test/filters/test_multi_flattener.rb → spec/filters/multi_flattener_spec.rb} +4 -4
- data/{test/filters/test_static_analyzer.rb → spec/filters/static_analyzer_spec.rb} +6 -8
- data/{test/filters/test_static_merger.rb → spec/filters/static_merger_spec.rb} +7 -7
- data/spec/filters/string_splitter_spec.rb +50 -0
- data/spec/generator_spec.rb +158 -0
- data/spec/grammar_spec.rb +47 -0
- data/{test/html/test_attribute_merger.rb → spec/html/attribute_merger_spec.rb} +11 -11
- data/{test/html/test_attribute_remover.rb → spec/html/attribute_remover_spec.rb} +7 -7
- data/{test/html/test_attribute_sorter.rb → spec/html/attribute_sorter_spec.rb} +7 -7
- data/{test/html/test_fast.rb → spec/html/fast_spec.rb} +23 -23
- data/{test/html/test_pretty.rb → spec/html/pretty_spec.rb} +7 -7
- data/spec/map_spec.rb +39 -0
- data/{test/mixins/test_dispatcher.rb → spec/mixins/dispatcher_spec.rb} +12 -12
- data/{test/mixins/test_grammar_dsl.rb → spec/mixins/grammar_dsl_spec.rb} +19 -19
- data/{test/helper.rb → spec/spec_helper.rb} +5 -6
- data/{test/test_static_analyzer.rb → spec/static_analyzer_spec.rb} +6 -6
- data/spec/utils_spec.rb +39 -0
- data/temple.gemspec +3 -4
- metadata +34 -59
- data/.travis.yml +0 -30
- data/test/filters/test_string_splitter.rb +0 -25
- data/test/test_engine.rb +0 -189
- data/test/test_filter.rb +0 -29
- data/test/test_generator.rb +0 -158
- data/test/test_grammar.rb +0 -47
- data/test/test_map.rb +0 -39
- data/test/test_utils.rb +0 -39
data/test/test_utils.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class UniqueTest
|
4
|
-
include Temple::Utils
|
5
|
-
end
|
6
|
-
|
7
|
-
describe Temple::Utils do
|
8
|
-
it 'has empty_exp?' do
|
9
|
-
Temple::Utils.empty_exp?([:multi]).should.be.true
|
10
|
-
Temple::Utils.empty_exp?([:multi, [:multi]]).should.be.true
|
11
|
-
Temple::Utils.empty_exp?([:multi, [:multi, [:newline]], [:newline]]).should.be.true
|
12
|
-
Temple::Utils.empty_exp?([:multi]).should.be.true
|
13
|
-
Temple::Utils.empty_exp?([:multi, [:multi, [:static, 'text']]]).should.be.false
|
14
|
-
Temple::Utils.empty_exp?([:multi, [:newline], [:multi, [:dynamic, 'text']]]).should.be.false
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'has unique_name' do
|
18
|
-
u = UniqueTest.new
|
19
|
-
u.unique_name.should.equal '_uniquetest1'
|
20
|
-
u.unique_name.should.equal '_uniquetest2'
|
21
|
-
UniqueTest.new.unique_name.should.equal '_uniquetest1'
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'has escape_html' do
|
25
|
-
Temple::Utils.escape_html('<').should.equal '<'
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'should escape unsafe html strings' do
|
29
|
-
with_html_safe do
|
30
|
-
Temple::Utils.escape_html_safe('<').should.equal '<'
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'should not escape safe html strings' do
|
35
|
-
with_html_safe do
|
36
|
-
Temple::Utils.escape_html_safe('<'.html_safe).should.equal '<'
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|