haml 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -5
- data/CHANGELOG.md +14 -0
- data/Gemfile +1 -0
- data/README.md +0 -6
- data/REFERENCE.md +9 -8
- data/Rakefile +12 -6
- data/haml.gemspec +0 -1
- data/lib/haml/attribute_compiler.rb +19 -11
- data/lib/haml/buffer.rb +1 -1
- data/lib/haml/compiler.rb +3 -3
- data/lib/haml/exec.rb +6 -1
- data/lib/haml/filters.rb +1 -1
- data/lib/haml/generator.rb +1 -1
- data/lib/haml/helpers.rb +1 -1
- data/lib/haml/helpers/action_view_mods.rb +6 -2
- data/lib/haml/parser.rb +1 -1
- data/lib/haml/sass_rails_filter.rb +1 -1
- data/lib/haml/version.rb +1 -1
- metadata +4 -22
- data/test/attribute_parser_test.rb +0 -105
- data/test/engine_test.rb +0 -2131
- data/test/filters_test.rb +0 -262
- data/test/helper_test.rb +0 -695
- data/test/options_test.rb +0 -22
- data/test/parser_test.rb +0 -172
- data/test/template_test.rb +0 -332
- data/test/temple_line_counter_test.rb +0 -40
- data/test/util_test.rb +0 -22
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TempleLineCounterTest < Haml::TestCase
|
4
|
-
TESTED_TEMPLES = [
|
5
|
-
[:multi,
|
6
|
-
[:code, "foo"],
|
7
|
-
[:static, "bar"],
|
8
|
-
[:dynamic, "baz"],
|
9
|
-
],
|
10
|
-
[:multi,
|
11
|
-
[:code, "foo\nbar\nbaz"],
|
12
|
-
[:static, "foo\nbar\nbaz"],
|
13
|
-
[:dynamic, "foo\nbar\nbaz"],
|
14
|
-
],
|
15
|
-
[:case,
|
16
|
-
["'a\nb', false", [:static, "hello\n"]],
|
17
|
-
[:else, [:code, "raise 'error\n'"]],
|
18
|
-
],
|
19
|
-
[:escape, true, [:dynamic, "foo\nbar"]],
|
20
|
-
[:escape, :once, [:dynamic, "foo\nbar"]],
|
21
|
-
[:escape, false, [:dynamic, "foo\nbar"]],
|
22
|
-
[:escape, true, [:static, "foo\nbar"]],
|
23
|
-
[:escape, :once, [:static, "foo\nbar"]],
|
24
|
-
[:escape, false, [:dynamic, "foo\nbar"]],
|
25
|
-
]
|
26
|
-
|
27
|
-
def test_count_lines
|
28
|
-
TESTED_TEMPLES.each do |temple|
|
29
|
-
code = Haml::TempleEngine.chain.inject(temple) do |exp, (symbol, filter)|
|
30
|
-
case symbol
|
31
|
-
when :Parser, :Compiler
|
32
|
-
exp
|
33
|
-
else
|
34
|
-
filter.call(Haml::TempleEngine).call(exp)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
assert_equal code.count("\n"), Haml::TempleLineCounter.count_lines(temple)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
data/test/util_test.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class UtilTest < Haml::TestCase
|
4
|
-
include Haml::Util
|
5
|
-
|
6
|
-
def test_silence_warnings
|
7
|
-
old_stderr, $stderr = $stderr, StringIO.new
|
8
|
-
warn "Out"
|
9
|
-
assert_equal("Out\n", $stderr.string)
|
10
|
-
silence_warnings {warn "In"}
|
11
|
-
assert_equal("Out\n", $stderr.string)
|
12
|
-
ensure
|
13
|
-
$stderr = old_stderr
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_check_encoding_does_not_destoy_the_given_string
|
17
|
-
string_with_bom = File.read(File.dirname(__FILE__) + '/templates/with_bom.haml', :encoding => Encoding::UTF_8)
|
18
|
-
original = string_with_bom.dup
|
19
|
-
check_encoding(string_with_bom)
|
20
|
-
assert_equal(original, string_with_bom)
|
21
|
-
end
|
22
|
-
end
|