hamlit 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f26748711e6ecbb403d8f33ca532985d71e47985
4
- data.tar.gz: cd5ba0bd80afab05b357a2cfe3cfba9720f3da17
3
+ metadata.gz: 3179fc842accfe9d500d85b4ab45abccd47cb1eb
4
+ data.tar.gz: 38eb7023728651efbd6d741b8d3de821e5dfc782
5
5
  SHA512:
6
- metadata.gz: 5c6363a1a3a810c5aec5d715c31d30e22c04ff6cea3aea763522ea3c06f3e6ede4ea3807101cd631b8c390d753b69c04439377f116d3661db04cb336c2b22fd9
7
- data.tar.gz: 81d9ac0d9e57f7c693bcf90f757cd0bc8a54a91a5a608375130704b3cc627a53fe085cf72d9f732342b50b201463e52ade08aee0a8f520ff98b2174977d6464a
6
+ metadata.gz: 74173d10d57f2419290f473b9b8a419a5f1cee0e371008bcbc1a7c18862796f7ecd18d0ce0bff63c2b44cf63f7f2e8c3be3e7c63919a97cfd061474a20ad0788
7
+ data.tar.gz: adfacd5b5d7625d66741e9fee4fa5ce3206a490cd91915406ebc758f47c53fe6732ef8bca5e23ca5a74846da9272565067351dba85f9c7d10a64de398c3ef3a5
@@ -1,3 +1,8 @@
1
+ ## v0.6.0
2
+
3
+ - Automatically escape html in all situations
4
+ - https://github.com/k0kubun/hamlit/pull/18
5
+
1
6
  ## v0.5.3
2
7
 
3
8
  - Bugfix for syntax error in data attribute hash
data/README.md CHANGED
@@ -50,18 +50,9 @@ Hamlit is used on [githubranking.com](http://githubranking.com/).
50
50
  Basically the same as [haml](https://github.com/haml/haml).
51
51
  Check out the [reference documentation](http://haml.info/docs/yardoc/file.REFERENCE.html) for details.
52
52
 
53
- ### Rails
53
+ ### Rails, Sinatra
54
54
 
55
- Just update Gemfile.
56
-
57
- ### Sinatra
58
-
59
- For compatibility with Haml, Hamlit does not escape html automatically in sinatra.
60
- You can enable html escaping manually:
61
-
62
- ```ruby
63
- set :haml, { escape_html: true }
64
- ```
55
+ Just update Gemfile. Html escaping is enabled by default.
65
56
 
66
57
  ## Why high performance?
67
58
  ### Less work on runtime
data/Rakefile CHANGED
@@ -11,16 +11,9 @@ task :spec do
11
11
  end
12
12
 
13
13
  namespace :spec do
14
- namespace :update do
15
- desc 'Generate converted ugly haml-spec'
16
- task :ugly do
17
- system('cd spec && rake ugly')
18
- end
19
-
20
- desc 'Generate converted pretty haml-spec'
21
- task :pretty do
22
- system('cd spec && rake pretty')
23
- end
14
+ desc 'Generate converted ugly haml-spec'
15
+ task :update do
16
+ system('cd spec && rake ugly')
24
17
  end
25
18
  end
26
19
 
@@ -34,7 +34,6 @@ class Benchmarks
34
34
  fast_erubis = Erubis::FastEruby.new(@erb_code)
35
35
  haml_ugly = Haml::Engine.new(@haml_code, format: :html5, ugly: true)
36
36
  tenjin = Tenjin::Engine.new.get_template(@rbhtml_path)
37
- hamlit = Hamlit::Engine.new(escape_html: true)
38
37
 
39
38
  context = Context.new
40
39
 
@@ -47,7 +46,7 @@ class Benchmarks
47
46
  def run_slim_ugly; #{Slim::Engine.new.call @slim_code}; end
48
47
  def run_faml; #{Faml::Engine.new.call @haml_code}; end
49
48
  def run_tenjin; _buf = ''; #{tenjin.script}; end
50
- def run_hamlit; #{hamlit.call @haml_code}; end
49
+ def run_hamlit; #{Hamlit::Engine.new.call @haml_code}; end
51
50
  }
52
51
 
53
52
  bench('hamlit', Hamlit::VERSION) { context.run_hamlit }
@@ -3,7 +3,6 @@ require 'hamlit/compilers/comment'
3
3
  require 'hamlit/compilers/doctype'
4
4
  require 'hamlit/compilers/dynamic'
5
5
  require 'hamlit/compilers/filter'
6
- require 'hamlit/compilers/preserve'
7
6
  require 'hamlit/compilers/script'
8
7
  require 'hamlit/compilers/strip'
9
8
  require 'hamlit/compilers/text'
@@ -16,7 +15,6 @@ module Hamlit
16
15
  include Compilers::Doctype
17
16
  include Compilers::Dynamic
18
17
  include Compilers::Filter
19
- include Compilers::Preserve
20
18
  include Compilers::Script
21
19
  include Compilers::Strip
22
20
  include Compilers::Text
@@ -1,7 +1,6 @@
1
1
  require 'hamlit/compilers/new_attribute'
2
2
  require 'hamlit/compilers/old_attribute'
3
3
  require 'hamlit/compilers/runtime_attribute'
4
- require 'hamlit/concerns/escapable'
5
4
  require 'hamlit/concerns/included'
6
5
 
7
6
  module Hamlit
@@ -13,8 +12,6 @@ module Hamlit
13
12
  include Compilers::RuntimeAttribute
14
13
 
15
14
  included do
16
- include Concerns::Escapable
17
-
18
15
  define_options :format, :attr_quote
19
16
  end
20
17
 
@@ -41,7 +38,7 @@ module Hamlit
41
38
  type, arg = value
42
39
  next attr unless name && type && type && arg
43
40
 
44
- [:html, :attr, name, escape_html(value, true)]
41
+ [:html, :attr, name, [:escape, true, value]]
45
42
  end
46
43
  end
47
44
 
@@ -1,20 +1,11 @@
1
- require 'hamlit/concerns/escapable'
2
- require 'hamlit/concerns/included'
3
-
4
1
  module Hamlit
5
2
  module Compilers
6
3
  module Script
7
- extend Concerns::Included
8
-
9
- included do
10
- include Concerns::Escapable
11
- end
12
-
13
4
  def on_haml_script(code, options, *exps)
14
5
  variable = result_identifier
15
6
 
16
7
  assign = [:code, "#{variable} = #{code}"]
17
- result = escape_html([:dynamic, variable], options[:force_escape])
8
+ result = [:escape, true, [:dynamic, variable]]
18
9
  result = [:dynamic, variable] if options[:disable_escape]
19
10
  [:multi, assign, *exps.map { |exp| compile(exp) }, compile(result)]
20
11
  end
@@ -1,21 +1,19 @@
1
1
  require 'temple'
2
2
  require 'hamlit/compiler'
3
- require 'hamlit/html/pretty'
4
- require 'hamlit/html/ugly'
3
+ require 'hamlit/html'
5
4
  require 'hamlit/parser'
6
5
 
7
6
  module Hamlit
8
7
  class Engine < Temple::Engine
9
8
  define_options(
10
- generator: Temple::Generators::ArrayBuffer,
11
- format: :html,
12
- attr_quote: "'",
13
- ugly: true,
9
+ generator: Temple::Generators::ArrayBuffer,
10
+ format: :html,
11
+ attr_quote: "'",
14
12
  )
15
13
 
16
14
  use Parser
17
15
  use Compiler
18
- use :Html, -> { create(html_compiler) }
16
+ use HTML
19
17
  filter :Escapable
20
18
  filter :ControlFlow
21
19
  filter :MultiFlattener
@@ -30,13 +28,5 @@ module Hamlit
30
28
  end
31
29
  klass.new(valid_options)
32
30
  end
33
-
34
- def html_compiler
35
- if options[:ugly]
36
- HTML::Ugly
37
- else
38
- HTML::Pretty
39
- end
40
- end
41
31
  end
42
32
  end
@@ -0,0 +1,10 @@
1
+ require 'hamlit/concerns/deprecation'
2
+ require 'temple/html/fast'
3
+
4
+ # This is created to be compatible with Haml's ugly mode.
5
+ # Currently pretty mode is not supported.
6
+ module Hamlit
7
+ class HTML < Temple::HTML::Fast
8
+ include Concerns::Deprecation
9
+ end
10
+ end
@@ -85,7 +85,7 @@ module Hamlit
85
85
  if scanner.scan(/\\/) || scanner.match?(/\#{/)
86
86
  return parse_text(scanner)
87
87
  elsif scanner.match?(/&=/)
88
- return parse_script(scanner, force_escape: true)
88
+ return parse_script(scanner)
89
89
  elsif scanner.match?(/!=/)
90
90
  return parse_script(scanner, disable_escape: true)
91
91
  elsif scanner.match?(/[.#](\Z|[^a-zA-Z0-9_-])/)
@@ -97,10 +97,8 @@ module Hamlit
97
97
  parse_doctype(scanner)
98
98
  when '%', '.', '#'
99
99
  parse_tag(scanner)
100
- when '='
100
+ when '=', '~'
101
101
  parse_script(scanner)
102
- when '~'
103
- parse_preserve(scanner)
104
102
  when '-'
105
103
  parse_silent_script(scanner)
106
104
  when '/'
@@ -1,31 +1,24 @@
1
- require 'hamlit/concerns/escapable'
2
1
  require 'hamlit/concerns/error'
3
- require 'hamlit/concerns/included'
4
2
  require 'hamlit/concerns/indentable'
5
3
 
6
4
  module Hamlit
7
5
  module Parsers
8
6
  module Script
9
- extend Concerns::Included
10
7
  include Concerns::Error
11
8
  include Concerns::Indentable
12
9
 
13
10
  INTERNAL_STATEMENTS = %w[else elsif when].freeze
14
- DEFAULT_SCRIPT_OPTIONS = { force_escape: false, disable_escape: false }.freeze
15
-
16
- included do
17
- include Concerns::Escapable
18
- end
11
+ DEFAULT_SCRIPT_OPTIONS = { disable_escape: false }.freeze
19
12
 
20
13
  def parse_script(scanner, options = {})
21
- assert_scan!(scanner, /=|&=|!=/)
14
+ assert_scan!(scanner, /=|&=|!=|~/)
22
15
  options = DEFAULT_SCRIPT_OPTIONS.merge(options)
23
16
 
24
17
  code, with_comment = scan_code(scanner, comment_check: true)
25
18
  return syntax_error("There's no Ruby code for = to evaluate.") if code.empty? && !with_comment
26
19
  unless has_block?
27
20
  return [:dynamic, code] if options[:disable_escape]
28
- return escape_html([:dynamic, code], options[:force_escape])
21
+ return [:escape, true, [:dynamic, code]]
29
22
  end
30
23
 
31
24
  ast = [:haml, :script, code, options]
@@ -34,13 +27,6 @@ module Hamlit
34
27
  ast
35
28
  end
36
29
 
37
- def parse_preserve(scanner)
38
- assert_scan!(scanner, /~/)
39
-
40
- code = scan_code(scanner)
41
- escape_html([:haml, :preserve, code])
42
- end
43
-
44
30
  def parse_silent_script(scanner)
45
31
  assert_scan!(scanner, /-/)
46
32
  if scanner.scan(/#/)
@@ -8,9 +8,7 @@ module Hamlit
8
8
  Hamlit::Engine,
9
9
  generator: Temple::Generators::RailsOutputBuffer,
10
10
  register_as: :haml,
11
- escape_html: true,
12
11
  streaming: true,
13
- ugly: true,
14
12
  )
15
13
 
16
14
  # Haml extends Haml::Helpers in ActionView each time.
@@ -1,3 +1,3 @@
1
1
  module Hamlit
2
- VERSION = "0.5.3"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -10,15 +10,21 @@ def generate_spec(mode)
10
10
 
11
11
  # This is a spec converted by haml-spec.
12
12
  # See: https://github.com/haml/haml-spec
13
- describe "haml #{mode} mode" do
14
- def assert_pretty(haml, locals, options)
15
- engine = Haml::Engine.new(haml, options)
16
- hamlit = Hamlit::Template.new(options) { haml }
13
+ describe "haml #{mode} mode with escape_html" do
14
+ DEFAULT_OPTIONS = { ugly: true, escape_html: true }.freeze
15
+
16
+ def assert_haml(haml, locals, options)
17
+ engine = Haml::Engine.new(haml, DEFAULT_OPTIONS.merge(options))
18
+ hamlit = Hamlit::Template.new(suppress_warnings(options)) { haml }
17
19
  expect(hamlit.render(Object.new, locals)).to eq(engine.render(Object.new, locals))
18
20
  end
19
21
 
20
- def assert_ugly(haml, locals, options)
21
- assert_pretty(haml, locals, { ugly: true }.merge(options))
22
+ # NOTE: Hamlit only supports escape_html mode.
23
+ # Thus the option is not supporeted and prints noisy warnings.
24
+ def suppress_warnings(options)
25
+ options = options.dup
26
+ options.delete(:escape_html)
27
+ options
22
28
  end
23
29
 
24
30
  SPEC
@@ -51,7 +57,7 @@ def generate_spec(mode)
51
57
  end
52
58
 
53
59
  spec += "end\n"
54
- File.write("hamlit/#{mode}_spec.rb", spec)
60
+ File.write("hamlit/haml_spec.rb", spec)
55
61
  end
56
62
 
57
63
  def generate_specify(test, locals, options, mode)
@@ -61,7 +67,7 @@ def generate_specify(test, locals, options, mode)
61
67
  html = %q{#{test[:html]}}
62
68
  locals = #{locals}
63
69
  options = #{options}
64
- assert_#{mode}(haml, locals, options)
70
+ assert_haml(haml, locals, options)
65
71
  end
66
72
  SPEC
67
73
  end
@@ -71,9 +77,4 @@ task :ugly do
71
77
  generate_spec(:ugly)
72
78
  end
73
79
 
74
- desc 'Convert tests.json into pretty rspec tests'
75
- task :pretty do
76
- generate_spec(:pretty)
77
- end
78
-
79
- task default: [:ugly, :pretty]
80
+ task default: :ugly
@@ -19,7 +19,7 @@ describe Hamlit::Engine do
19
19
  HAML
20
20
 
21
21
  ##
22
- ["#", "#"]
22
+ [&quot;#&quot;, &quot;#&quot;]
23
23
  HTML
24
24
  end
25
25
 
@@ -76,7 +76,7 @@ describe Hamlit::Engine do
76
76
  end
77
77
 
78
78
  it 'renders !=' do
79
- assert_render(<<-HAML, <<-HTML, escape_html: true)
79
+ assert_render(<<-HAML, <<-HTML)
80
80
  != '<"&>'
81
81
  != '<"&>'.tap do |str|
82
82
  -# no operation
@@ -87,7 +87,7 @@ describe Hamlit::Engine do
87
87
  end
88
88
 
89
89
  it 'renders &=' do
90
- assert_render(<<-HAML, <<-HTML, escape_html: false)
90
+ assert_render(<<-HAML, <<-HTML)
91
91
  &= '<"&>'
92
92
  &= '<"&>'.tap do |str|
93
93
  -# no operation
@@ -96,5 +96,14 @@ describe Hamlit::Engine do
96
96
  &lt;&quot;&amp;&gt;
97
97
  HTML
98
98
  end
99
+
100
+ it 'regards ~ operator as =' do
101
+ assert_render(<<-'HAML', <<-HTML)
102
+ ~ "<code>hello\nworld</code>"
103
+ HAML
104
+ &lt;code&gt;hello
105
+ world&lt;/code&gt;
106
+ HTML
107
+ end
99
108
  end
100
109
  end
@@ -154,7 +154,7 @@ describe Hamlit::Engine do
154
154
 
155
155
  it 'joins a next line if a current line ends with ","' do
156
156
  assert_render("- foo = [', \n ']\n= foo", <<-HTML)
157
- [", "]
157
+ [&quot;, &quot;]
158
158
  HTML
159
159
  end
160
160
 
@@ -7,7 +7,6 @@ describe Hamlit::Engine do
7
7
  {
8
8
  buffer: buffer,
9
9
  generator: Temple::Generators::ArrayBuffer,
10
- ugly: true,
11
10
  }
12
11
  end
13
12
 
@@ -2,15 +2,21 @@ require "haml"
2
2
 
3
3
  # This is a spec converted by haml-spec.
4
4
  # See: https://github.com/haml/haml-spec
5
- describe "haml ugly mode" do
6
- def assert_pretty(haml, locals, options)
7
- engine = Haml::Engine.new(haml, options)
8
- hamlit = Hamlit::Template.new(options) { haml }
5
+ describe "haml ugly mode with escape_html" do
6
+ DEFAULT_OPTIONS = { ugly: true, escape_html: true }.freeze
7
+
8
+ def assert_haml(haml, locals, options)
9
+ engine = Haml::Engine.new(haml, DEFAULT_OPTIONS.merge(options))
10
+ hamlit = Hamlit::Template.new(suppress_warnings(options)) { haml }
9
11
  expect(hamlit.render(Object.new, locals)).to eq(engine.render(Object.new, locals))
10
12
  end
11
13
 
12
- def assert_ugly(haml, locals, options)
13
- assert_pretty(haml, locals, { ugly: true }.merge(options))
14
+ # NOTE: Hamlit only supports escape_html mode.
15
+ # Thus the option is not supporeted and prints noisy warnings.
16
+ def suppress_warnings(options)
17
+ options = options.dup
18
+ options.delete(:escape_html)
19
+ options
14
20
  end
15
21
 
16
22
  context "headers" do
@@ -19,7 +25,7 @@ describe "haml ugly mode" do
19
25
  html = %q{<?xml version='1.0' encoding='utf-8' ?>}
20
26
  locals = {}
21
27
  options = {:format=>:xhtml}
22
- assert_ugly(haml, locals, options)
28
+ assert_haml(haml, locals, options)
23
29
  end
24
30
 
25
31
  specify "an XHTML default (transitional) doctype" do
@@ -27,7 +33,7 @@ describe "haml ugly mode" do
27
33
  html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">}
28
34
  locals = {}
29
35
  options = {:format=>:xhtml}
30
- assert_ugly(haml, locals, options)
36
+ assert_haml(haml, locals, options)
31
37
  end
32
38
 
33
39
  specify "an XHTML 1.1 doctype" do
@@ -35,7 +41,7 @@ describe "haml ugly mode" do
35
41
  html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">}
36
42
  locals = {}
37
43
  options = {:format=>:xhtml}
38
- assert_ugly(haml, locals, options)
44
+ assert_haml(haml, locals, options)
39
45
  end
40
46
 
41
47
  specify "an XHTML 1.2 mobile doctype" do
@@ -43,7 +49,7 @@ describe "haml ugly mode" do
43
49
  html = %q{<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">}
44
50
  locals = {}
45
51
  options = {:format=>:xhtml}
46
- assert_ugly(haml, locals, options)
52
+ assert_haml(haml, locals, options)
47
53
  end
48
54
 
49
55
  specify "an XHTML 1.1 basic doctype" do
@@ -51,7 +57,7 @@ describe "haml ugly mode" do
51
57
  html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">}
52
58
  locals = {}
53
59
  options = {:format=>:xhtml}
54
- assert_ugly(haml, locals, options)
60
+ assert_haml(haml, locals, options)
55
61
  end
56
62
 
57
63
  specify "an XHTML 1.0 frameset doctype" do
@@ -59,7 +65,7 @@ describe "haml ugly mode" do
59
65
  html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">}
60
66
  locals = {}
61
67
  options = {:format=>:xhtml}
62
- assert_ugly(haml, locals, options)
68
+ assert_haml(haml, locals, options)
63
69
  end
64
70
 
65
71
  specify "an HTML 5 doctype with XHTML syntax" do
@@ -67,7 +73,7 @@ describe "haml ugly mode" do
67
73
  html = %q{<!DOCTYPE html>}
68
74
  locals = {}
69
75
  options = {:format=>:xhtml}
70
- assert_ugly(haml, locals, options)
76
+ assert_haml(haml, locals, options)
71
77
  end
72
78
 
73
79
  specify "an HTML 5 XML prolog (silent)" do
@@ -75,7 +81,7 @@ describe "haml ugly mode" do
75
81
  html = %q{}
76
82
  locals = {}
77
83
  options = {:format=>:html5}
78
- assert_ugly(haml, locals, options)
84
+ assert_haml(haml, locals, options)
79
85
  end
80
86
 
81
87
  specify "an HTML 5 doctype" do
@@ -83,7 +89,7 @@ describe "haml ugly mode" do
83
89
  html = %q{<!DOCTYPE html>}
84
90
  locals = {}
85
91
  options = {:format=>:html5}
86
- assert_ugly(haml, locals, options)
92
+ assert_haml(haml, locals, options)
87
93
  end
88
94
 
89
95
  specify "an HTML 4 XML prolog (silent)" do
@@ -91,7 +97,7 @@ describe "haml ugly mode" do
91
97
  html = %q{}
92
98
  locals = {}
93
99
  options = {:format=>:html4}
94
- assert_ugly(haml, locals, options)
100
+ assert_haml(haml, locals, options)
95
101
  end
96
102
 
97
103
  specify "an HTML 4 default (transitional) doctype" do
@@ -99,7 +105,7 @@ describe "haml ugly mode" do
99
105
  html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">}
100
106
  locals = {}
101
107
  options = {:format=>:html4}
102
- assert_ugly(haml, locals, options)
108
+ assert_haml(haml, locals, options)
103
109
  end
104
110
 
105
111
  specify "an HTML 4 frameset doctype" do
@@ -107,7 +113,7 @@ describe "haml ugly mode" do
107
113
  html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">}
108
114
  locals = {}
109
115
  options = {:format=>:html4}
110
- assert_ugly(haml, locals, options)
116
+ assert_haml(haml, locals, options)
111
117
  end
112
118
 
113
119
  specify "an HTML 4 strict doctype" do
@@ -115,7 +121,7 @@ describe "haml ugly mode" do
115
121
  html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">}
116
122
  locals = {}
117
123
  options = {:format=>:html4}
118
- assert_ugly(haml, locals, options)
124
+ assert_haml(haml, locals, options)
119
125
  end
120
126
  end
121
127
 
@@ -125,7 +131,7 @@ describe "haml ugly mode" do
125
131
  html = %q{<p></p>}
126
132
  locals = {}
127
133
  options = {}
128
- assert_ugly(haml, locals, options)
134
+ assert_haml(haml, locals, options)
129
135
  end
130
136
 
131
137
  specify "a self-closing tag (XHTML)" do
@@ -133,7 +139,7 @@ describe "haml ugly mode" do
133
139
  html = %q{<meta />}
134
140
  locals = {}
135
141
  options = {:format=>:xhtml}
136
- assert_ugly(haml, locals, options)
142
+ assert_haml(haml, locals, options)
137
143
  end
138
144
 
139
145
  specify "a self-closing tag (HTML4)" do
@@ -141,7 +147,7 @@ describe "haml ugly mode" do
141
147
  html = %q{<meta>}
142
148
  locals = {}
143
149
  options = {:format=>:html4}
144
- assert_ugly(haml, locals, options)
150
+ assert_haml(haml, locals, options)
145
151
  end
146
152
 
147
153
  specify "a self-closing tag (HTML5)" do
@@ -149,7 +155,7 @@ describe "haml ugly mode" do
149
155
  html = %q{<meta>}
150
156
  locals = {}
151
157
  options = {:format=>:html5}
152
- assert_ugly(haml, locals, options)
158
+ assert_haml(haml, locals, options)
153
159
  end
154
160
 
155
161
  specify "a self-closing tag ('/' modifier + XHTML)" do
@@ -157,7 +163,7 @@ describe "haml ugly mode" do
157
163
  html = %q{<zzz />}
158
164
  locals = {}
159
165
  options = {:format=>:xhtml}
160
- assert_ugly(haml, locals, options)
166
+ assert_haml(haml, locals, options)
161
167
  end
162
168
 
163
169
  specify "a self-closing tag ('/' modifier + HTML5)" do
@@ -165,7 +171,7 @@ describe "haml ugly mode" do
165
171
  html = %q{<zzz>}
166
172
  locals = {}
167
173
  options = {:format=>:html5}
168
- assert_ugly(haml, locals, options)
174
+ assert_haml(haml, locals, options)
169
175
  end
170
176
 
171
177
  specify "a tag with a CSS class" do
@@ -173,7 +179,7 @@ describe "haml ugly mode" do
173
179
  html = %q{<p class='class1'></p>}
174
180
  locals = {}
175
181
  options = {}
176
- assert_ugly(haml, locals, options)
182
+ assert_haml(haml, locals, options)
177
183
  end
178
184
 
179
185
  specify "a tag with multiple CSS classes" do
@@ -181,7 +187,7 @@ describe "haml ugly mode" do
181
187
  html = %q{<p class='class1 class2'></p>}
182
188
  locals = {}
183
189
  options = {}
184
- assert_ugly(haml, locals, options)
190
+ assert_haml(haml, locals, options)
185
191
  end
186
192
 
187
193
  specify "a tag with a CSS id" do
@@ -189,7 +195,7 @@ describe "haml ugly mode" do
189
195
  html = %q{<p id='id1'></p>}
190
196
  locals = {}
191
197
  options = {}
192
- assert_ugly(haml, locals, options)
198
+ assert_haml(haml, locals, options)
193
199
  end
194
200
 
195
201
  specify "a tag with multiple CSS id's" do
@@ -197,7 +203,7 @@ describe "haml ugly mode" do
197
203
  html = %q{<p id='id2'></p>}
198
204
  locals = {}
199
205
  options = {}
200
- assert_ugly(haml, locals, options)
206
+ assert_haml(haml, locals, options)
201
207
  end
202
208
 
203
209
  specify "a tag with a class followed by an id" do
@@ -205,7 +211,7 @@ describe "haml ugly mode" do
205
211
  html = %q{<p class='class1' id='id1'></p>}
206
212
  locals = {}
207
213
  options = {}
208
- assert_ugly(haml, locals, options)
214
+ assert_haml(haml, locals, options)
209
215
  end
210
216
 
211
217
  specify "a tag with an id followed by a class" do
@@ -213,7 +219,7 @@ describe "haml ugly mode" do
213
219
  html = %q{<p class='class1' id='id1'></p>}
214
220
  locals = {}
215
221
  options = {}
216
- assert_ugly(haml, locals, options)
222
+ assert_haml(haml, locals, options)
217
223
  end
218
224
 
219
225
  specify "an implicit div with a CSS id" do
@@ -221,7 +227,7 @@ describe "haml ugly mode" do
221
227
  html = %q{<div id='id1'></div>}
222
228
  locals = {}
223
229
  options = {}
224
- assert_ugly(haml, locals, options)
230
+ assert_haml(haml, locals, options)
225
231
  end
226
232
 
227
233
  specify "an implicit div with a CSS class" do
@@ -229,7 +235,7 @@ describe "haml ugly mode" do
229
235
  html = %q{<div class='class1'></div>}
230
236
  locals = {}
231
237
  options = {}
232
- assert_ugly(haml, locals, options)
238
+ assert_haml(haml, locals, options)
233
239
  end
234
240
 
235
241
  specify "multiple simple Haml tags" do
@@ -243,7 +249,7 @@ describe "haml ugly mode" do
243
249
  </div>}
244
250
  locals = {}
245
251
  options = {}
246
- assert_ugly(haml, locals, options)
252
+ assert_haml(haml, locals, options)
247
253
  end
248
254
  end
249
255
 
@@ -253,7 +259,7 @@ describe "haml ugly mode" do
253
259
  html = %q{<ns:tag></ns:tag>}
254
260
  locals = {}
255
261
  options = {}
256
- assert_ugly(haml, locals, options)
262
+ assert_haml(haml, locals, options)
257
263
  end
258
264
 
259
265
  specify "a tag with underscores" do
@@ -261,7 +267,7 @@ describe "haml ugly mode" do
261
267
  html = %q{<snake_case></snake_case>}
262
268
  locals = {}
263
269
  options = {}
264
- assert_ugly(haml, locals, options)
270
+ assert_haml(haml, locals, options)
265
271
  end
266
272
 
267
273
  specify "a tag with dashes" do
@@ -269,7 +275,7 @@ describe "haml ugly mode" do
269
275
  html = %q{<dashed-tag></dashed-tag>}
270
276
  locals = {}
271
277
  options = {}
272
- assert_ugly(haml, locals, options)
278
+ assert_haml(haml, locals, options)
273
279
  end
274
280
 
275
281
  specify "a tag with camelCase" do
@@ -277,7 +283,7 @@ describe "haml ugly mode" do
277
283
  html = %q{<camelCase></camelCase>}
278
284
  locals = {}
279
285
  options = {}
280
- assert_ugly(haml, locals, options)
286
+ assert_haml(haml, locals, options)
281
287
  end
282
288
 
283
289
  specify "a tag with PascalCase" do
@@ -285,7 +291,7 @@ describe "haml ugly mode" do
285
291
  html = %q{<PascalCase></PascalCase>}
286
292
  locals = {}
287
293
  options = {}
288
- assert_ugly(haml, locals, options)
294
+ assert_haml(haml, locals, options)
289
295
  end
290
296
  end
291
297
 
@@ -295,7 +301,7 @@ describe "haml ugly mode" do
295
301
  html = %q{<div class='123'></div>}
296
302
  locals = {}
297
303
  options = {}
298
- assert_ugly(haml, locals, options)
304
+ assert_haml(haml, locals, options)
299
305
  end
300
306
 
301
307
  specify "a class with underscores" do
@@ -303,7 +309,7 @@ describe "haml ugly mode" do
303
309
  html = %q{<div class='__'></div>}
304
310
  locals = {}
305
311
  options = {}
306
- assert_ugly(haml, locals, options)
312
+ assert_haml(haml, locals, options)
307
313
  end
308
314
 
309
315
  specify "a class with dashes" do
@@ -311,7 +317,7 @@ describe "haml ugly mode" do
311
317
  html = %q{<div class='--'></div>}
312
318
  locals = {}
313
319
  options = {}
314
- assert_ugly(haml, locals, options)
320
+ assert_haml(haml, locals, options)
315
321
  end
316
322
  end
317
323
 
@@ -321,7 +327,7 @@ describe "haml ugly mode" do
321
327
  html = %q{<p>hello</p>}
322
328
  locals = {}
323
329
  options = {}
324
- assert_ugly(haml, locals, options)
330
+ assert_haml(haml, locals, options)
325
331
  end
326
332
 
327
333
  specify "Inline content tag with CSS" do
@@ -329,7 +335,7 @@ describe "haml ugly mode" do
329
335
  html = %q{<p class='class1'>hello</p>}
330
336
  locals = {}
331
337
  options = {}
332
- assert_ugly(haml, locals, options)
338
+ assert_haml(haml, locals, options)
333
339
  end
334
340
 
335
341
  specify "Inline content multiple simple tags" do
@@ -343,7 +349,7 @@ describe "haml ugly mode" do
343
349
  </div>}
344
350
  locals = {}
345
351
  options = {}
346
- assert_ugly(haml, locals, options)
352
+ assert_haml(haml, locals, options)
347
353
  end
348
354
  end
349
355
 
@@ -356,7 +362,7 @@ describe "haml ugly mode" do
356
362
  </p>}
357
363
  locals = {}
358
364
  options = {}
359
- assert_ugly(haml, locals, options)
365
+ assert_haml(haml, locals, options)
360
366
  end
361
367
 
362
368
  specify "Nested content tag with CSS" do
@@ -367,7 +373,7 @@ describe "haml ugly mode" do
367
373
  </p>}
368
374
  locals = {}
369
375
  options = {}
370
- assert_ugly(haml, locals, options)
376
+ assert_haml(haml, locals, options)
371
377
  end
372
378
 
373
379
  specify "Nested content multiple simple tags" do
@@ -384,7 +390,7 @@ describe "haml ugly mode" do
384
390
  </div>}
385
391
  locals = {}
386
392
  options = {}
387
- assert_ugly(haml, locals, options)
393
+ assert_haml(haml, locals, options)
388
394
  end
389
395
  end
390
396
 
@@ -394,7 +400,7 @@ describe "haml ugly mode" do
394
400
  html = %q{<p a='b'></p>}
395
401
  locals = {}
396
402
  options = {}
397
- assert_ugly(haml, locals, options)
403
+ assert_haml(haml, locals, options)
398
404
  end
399
405
 
400
406
  specify "HTML-style multiple attributes" do
@@ -402,7 +408,7 @@ describe "haml ugly mode" do
402
408
  html = %q{<p a='b' c='d'></p>}
403
409
  locals = {}
404
410
  options = {}
405
- assert_ugly(haml, locals, options)
411
+ assert_haml(haml, locals, options)
406
412
  end
407
413
 
408
414
  specify "HTML-style attributes separated with newlines" do
@@ -411,7 +417,7 @@ describe "haml ugly mode" do
411
417
  html = %q{<p a='b' c='d'></p>}
412
418
  locals = {}
413
419
  options = {}
414
- assert_ugly(haml, locals, options)
420
+ assert_haml(haml, locals, options)
415
421
  end
416
422
 
417
423
  specify "HTML-style interpolated attribute" do
@@ -419,7 +425,7 @@ describe "haml ugly mode" do
419
425
  html = %q{<p a='value'></p>}
420
426
  locals = {:var=>"value"}
421
427
  options = {}
422
- assert_ugly(haml, locals, options)
428
+ assert_haml(haml, locals, options)
423
429
  end
424
430
 
425
431
  specify "HTML-style 'class' as an attribute" do
@@ -427,7 +433,7 @@ describe "haml ugly mode" do
427
433
  html = %q{<p class='class1'></p>}
428
434
  locals = {}
429
435
  options = {}
430
- assert_ugly(haml, locals, options)
436
+ assert_haml(haml, locals, options)
431
437
  end
432
438
 
433
439
  specify "HTML-style tag with a CSS class and 'class' as an attribute" do
@@ -435,7 +441,7 @@ describe "haml ugly mode" do
435
441
  html = %q{<p class='class1 class2'></p>}
436
442
  locals = {}
437
443
  options = {}
438
- assert_ugly(haml, locals, options)
444
+ assert_haml(haml, locals, options)
439
445
  end
440
446
 
441
447
  specify "HTML-style tag with 'id' as an attribute" do
@@ -443,7 +449,7 @@ describe "haml ugly mode" do
443
449
  html = %q{<p id='1'></p>}
444
450
  locals = {}
445
451
  options = {}
446
- assert_ugly(haml, locals, options)
452
+ assert_haml(haml, locals, options)
447
453
  end
448
454
 
449
455
  specify "HTML-style tag with a CSS id and 'id' as an attribute" do
@@ -451,7 +457,7 @@ describe "haml ugly mode" do
451
457
  html = %q{<p id='id_1'></p>}
452
458
  locals = {}
453
459
  options = {}
454
- assert_ugly(haml, locals, options)
460
+ assert_haml(haml, locals, options)
455
461
  end
456
462
 
457
463
  specify "HTML-style tag with a variable attribute" do
@@ -459,7 +465,7 @@ describe "haml ugly mode" do
459
465
  html = %q{<p class='hello'></p>}
460
466
  locals = {:var=>"hello"}
461
467
  options = {}
462
- assert_ugly(haml, locals, options)
468
+ assert_haml(haml, locals, options)
463
469
  end
464
470
 
465
471
  specify "HTML-style tag with a CSS class and 'class' as a variable attribute" do
@@ -467,7 +473,7 @@ describe "haml ugly mode" do
467
473
  html = %q{<div class='hello world'></div>}
468
474
  locals = {:var=>"world"}
469
475
  options = {}
470
- assert_ugly(haml, locals, options)
476
+ assert_haml(haml, locals, options)
471
477
  end
472
478
 
473
479
  specify "HTML-style tag multiple CSS classes (sorted correctly)" do
@@ -475,7 +481,7 @@ describe "haml ugly mode" do
475
481
  html = %q{<div class='a z'></div>}
476
482
  locals = {:var=>"a"}
477
483
  options = {}
478
- assert_ugly(haml, locals, options)
484
+ assert_haml(haml, locals, options)
479
485
  end
480
486
 
481
487
  specify "HTML-style tag with an atomic attribute" do
@@ -483,7 +489,7 @@ describe "haml ugly mode" do
483
489
  html = %q{<a flag></a>}
484
490
  locals = {}
485
491
  options = {}
486
- assert_ugly(haml, locals, options)
492
+ assert_haml(haml, locals, options)
487
493
  end
488
494
  end
489
495
 
@@ -493,7 +499,7 @@ describe "haml ugly mode" do
493
499
  html = %q{<p a='b'></p>}
494
500
  locals = {}
495
501
  options = {}
496
- assert_ugly(haml, locals, options)
502
+ assert_haml(haml, locals, options)
497
503
  end
498
504
 
499
505
  specify "Ruby-style attributes hash with whitespace" do
@@ -501,7 +507,7 @@ describe "haml ugly mode" do
501
507
  html = %q{<p a='b'></p>}
502
508
  locals = {}
503
509
  options = {}
504
- assert_ugly(haml, locals, options)
510
+ assert_haml(haml, locals, options)
505
511
  end
506
512
 
507
513
  specify "Ruby-style interpolated attribute" do
@@ -509,7 +515,7 @@ describe "haml ugly mode" do
509
515
  html = %q{<p a='value'></p>}
510
516
  locals = {:var=>"value"}
511
517
  options = {}
512
- assert_ugly(haml, locals, options)
518
+ assert_haml(haml, locals, options)
513
519
  end
514
520
 
515
521
  specify "Ruby-style multiple attributes" do
@@ -517,7 +523,7 @@ describe "haml ugly mode" do
517
523
  html = %q{<p a='b' c='d'></p>}
518
524
  locals = {}
519
525
  options = {}
520
- assert_ugly(haml, locals, options)
526
+ assert_haml(haml, locals, options)
521
527
  end
522
528
 
523
529
  specify "Ruby-style attributes separated with newlines" do
@@ -526,7 +532,7 @@ describe "haml ugly mode" do
526
532
  html = %q{<p a='b' c='d'></p>}
527
533
  locals = {}
528
534
  options = {}
529
- assert_ugly(haml, locals, options)
535
+ assert_haml(haml, locals, options)
530
536
  end
531
537
 
532
538
  specify "Ruby-style 'class' as an attribute" do
@@ -534,7 +540,7 @@ describe "haml ugly mode" do
534
540
  html = %q{<p class='class1'></p>}
535
541
  locals = {}
536
542
  options = {}
537
- assert_ugly(haml, locals, options)
543
+ assert_haml(haml, locals, options)
538
544
  end
539
545
 
540
546
  specify "Ruby-style tag with a CSS class and 'class' as an attribute" do
@@ -542,7 +548,7 @@ describe "haml ugly mode" do
542
548
  html = %q{<p class='class1 class2'></p>}
543
549
  locals = {}
544
550
  options = {}
545
- assert_ugly(haml, locals, options)
551
+ assert_haml(haml, locals, options)
546
552
  end
547
553
 
548
554
  specify "Ruby-style tag with 'id' as an attribute" do
@@ -550,7 +556,7 @@ describe "haml ugly mode" do
550
556
  html = %q{<p id='1'></p>}
551
557
  locals = {}
552
558
  options = {}
553
- assert_ugly(haml, locals, options)
559
+ assert_haml(haml, locals, options)
554
560
  end
555
561
 
556
562
  specify "Ruby-style tag with a CSS id and 'id' as an attribute" do
@@ -558,7 +564,7 @@ describe "haml ugly mode" do
558
564
  html = %q{<p id='id_1'></p>}
559
565
  locals = {}
560
566
  options = {}
561
- assert_ugly(haml, locals, options)
567
+ assert_haml(haml, locals, options)
562
568
  end
563
569
 
564
570
  specify "Ruby-style tag with a CSS id and a numeric 'id' as an attribute" do
@@ -566,7 +572,7 @@ describe "haml ugly mode" do
566
572
  html = %q{<p id='id_1'></p>}
567
573
  locals = {}
568
574
  options = {}
569
- assert_ugly(haml, locals, options)
575
+ assert_haml(haml, locals, options)
570
576
  end
571
577
 
572
578
  specify "Ruby-style tag with a variable attribute" do
@@ -574,7 +580,7 @@ describe "haml ugly mode" do
574
580
  html = %q{<p class='hello'></p>}
575
581
  locals = {:var=>"hello"}
576
582
  options = {}
577
- assert_ugly(haml, locals, options)
583
+ assert_haml(haml, locals, options)
578
584
  end
579
585
 
580
586
  specify "Ruby-style tag with a CSS class and 'class' as a variable attribute" do
@@ -582,7 +588,7 @@ describe "haml ugly mode" do
582
588
  html = %q{<div class='hello world'></div>}
583
589
  locals = {:var=>"world"}
584
590
  options = {}
585
- assert_ugly(haml, locals, options)
591
+ assert_haml(haml, locals, options)
586
592
  end
587
593
 
588
594
  specify "Ruby-style tag multiple CSS classes (sorted correctly)" do
@@ -590,7 +596,7 @@ describe "haml ugly mode" do
590
596
  html = %q{<div class='a z'></div>}
591
597
  locals = {:var=>"a"}
592
598
  options = {}
593
- assert_ugly(haml, locals, options)
599
+ assert_haml(haml, locals, options)
594
600
  end
595
601
  end
596
602
 
@@ -600,7 +606,7 @@ describe "haml ugly mode" do
600
606
  html = %q{}
601
607
  locals = {}
602
608
  options = {}
603
- assert_ugly(haml, locals, options)
609
+ assert_haml(haml, locals, options)
604
610
  end
605
611
 
606
612
  specify "a nested silent comment" do
@@ -609,7 +615,7 @@ describe "haml ugly mode" do
609
615
  html = %q{}
610
616
  locals = {}
611
617
  options = {}
612
- assert_ugly(haml, locals, options)
618
+ assert_haml(haml, locals, options)
613
619
  end
614
620
 
615
621
  specify "a multiply nested silent comment" do
@@ -619,7 +625,7 @@ describe "haml ugly mode" do
619
625
  html = %q{}
620
626
  locals = {}
621
627
  options = {}
622
- assert_ugly(haml, locals, options)
628
+ assert_haml(haml, locals, options)
623
629
  end
624
630
 
625
631
  specify "a multiply nested silent comment with inconsistent indents" do
@@ -629,7 +635,7 @@ describe "haml ugly mode" do
629
635
  html = %q{}
630
636
  locals = {}
631
637
  options = {}
632
- assert_ugly(haml, locals, options)
638
+ assert_haml(haml, locals, options)
633
639
  end
634
640
  end
635
641
 
@@ -639,7 +645,7 @@ describe "haml ugly mode" do
639
645
  html = %q{<!-- comment -->}
640
646
  locals = {}
641
647
  options = {}
642
- assert_ugly(haml, locals, options)
648
+ assert_haml(haml, locals, options)
643
649
  end
644
650
 
645
651
  specify "a nested markup comment" do
@@ -652,7 +658,7 @@ describe "haml ugly mode" do
652
658
  -->}
653
659
  locals = {}
654
660
  options = {}
655
- assert_ugly(haml, locals, options)
661
+ assert_haml(haml, locals, options)
656
662
  end
657
663
  end
658
664
 
@@ -665,7 +671,7 @@ describe "haml ugly mode" do
665
671
  <![endif]-->}
666
672
  locals = {}
667
673
  options = {}
668
- assert_ugly(haml, locals, options)
674
+ assert_haml(haml, locals, options)
669
675
  end
670
676
  end
671
677
 
@@ -676,7 +682,7 @@ describe "haml ugly mode" do
676
682
  html = %q{&lt;&amp;&quot;&gt;}
677
683
  locals = {}
678
684
  options = {}
679
- assert_ugly(haml, locals, options)
685
+ assert_haml(haml, locals, options)
680
686
  end
681
687
 
682
688
  specify "content in a 'preserve' filter" do
@@ -688,7 +694,7 @@ describe "haml ugly mode" do
688
694
  <p></p>}
689
695
  locals = {}
690
696
  options = {}
691
- assert_ugly(haml, locals, options)
697
+ assert_haml(haml, locals, options)
692
698
  end
693
699
 
694
700
  specify "content in a 'plain' filter" do
@@ -700,7 +706,7 @@ describe "haml ugly mode" do
700
706
  <p></p>}
701
707
  locals = {}
702
708
  options = {}
703
- assert_ugly(haml, locals, options)
709
+ assert_haml(haml, locals, options)
704
710
  end
705
711
 
706
712
  specify "content in a 'css' filter (XHTML)" do
@@ -716,7 +722,7 @@ describe "haml ugly mode" do
716
722
  <p></p>}
717
723
  locals = {}
718
724
  options = {:format=>:xhtml}
719
- assert_ugly(haml, locals, options)
725
+ assert_haml(haml, locals, options)
720
726
  end
721
727
 
722
728
  specify "content in a 'javascript' filter (XHTML)" do
@@ -731,7 +737,7 @@ describe "haml ugly mode" do
731
737
  <p></p>}
732
738
  locals = {}
733
739
  options = {:format=>:xhtml}
734
- assert_ugly(haml, locals, options)
740
+ assert_haml(haml, locals, options)
735
741
  end
736
742
 
737
743
  specify "content in a 'css' filter (HTML)" do
@@ -745,7 +751,7 @@ describe "haml ugly mode" do
745
751
  <p></p>}
746
752
  locals = {}
747
753
  options = {:format=>:html5}
748
- assert_ugly(haml, locals, options)
754
+ assert_haml(haml, locals, options)
749
755
  end
750
756
 
751
757
  specify "content in a 'javascript' filter (HTML)" do
@@ -758,7 +764,7 @@ describe "haml ugly mode" do
758
764
  <p></p>}
759
765
  locals = {}
760
766
  options = {:format=>:html5}
761
- assert_ugly(haml, locals, options)
767
+ assert_haml(haml, locals, options)
762
768
  end
763
769
  end
764
770
 
@@ -768,7 +774,7 @@ describe "haml ugly mode" do
768
774
  html = %q{<p>value</p>}
769
775
  locals = {:var=>"value"}
770
776
  options = {}
771
- assert_ugly(haml, locals, options)
777
+ assert_haml(haml, locals, options)
772
778
  end
773
779
 
774
780
  specify "no interpolation when escaped" do
@@ -776,7 +782,7 @@ describe "haml ugly mode" do
776
782
  html = %q{<p>#{var}</p>}
777
783
  locals = {:var=>"value"}
778
784
  options = {}
779
- assert_ugly(haml, locals, options)
785
+ assert_haml(haml, locals, options)
780
786
  end
781
787
 
782
788
  specify "interpolation when the escape character is escaped" do
@@ -784,7 +790,7 @@ describe "haml ugly mode" do
784
790
  html = %q{<p>\value</p>}
785
791
  locals = {:var=>"value"}
786
792
  options = {}
787
- assert_ugly(haml, locals, options)
793
+ assert_haml(haml, locals, options)
788
794
  end
789
795
 
790
796
  specify "interpolation inside filtered content" do
@@ -793,7 +799,7 @@ describe "haml ugly mode" do
793
799
  html = %q{value interpolated: value}
794
800
  locals = {:var=>"value"}
795
801
  options = {}
796
- assert_ugly(haml, locals, options)
802
+ assert_haml(haml, locals, options)
797
803
  end
798
804
  end
799
805
 
@@ -803,7 +809,7 @@ describe "haml ugly mode" do
803
809
  html = %q{&lt;&quot;&amp;&gt;}
804
810
  locals = {}
805
811
  options = {}
806
- assert_ugly(haml, locals, options)
812
+ assert_haml(haml, locals, options)
807
813
  end
808
814
 
809
815
  specify "code following '=' when escape_haml is set to true" do
@@ -811,7 +817,7 @@ describe "haml ugly mode" do
811
817
  html = %q{&lt;&quot;&amp;&gt;}
812
818
  locals = {}
813
819
  options = {:escape_html=>"true"}
814
- assert_ugly(haml, locals, options)
820
+ assert_haml(haml, locals, options)
815
821
  end
816
822
 
817
823
  specify "code following '!=' when escape_haml is set to true" do
@@ -819,7 +825,7 @@ describe "haml ugly mode" do
819
825
  html = %q{<"&>}
820
826
  locals = {}
821
827
  options = {:escape_html=>"true"}
822
- assert_ugly(haml, locals, options)
828
+ assert_haml(haml, locals, options)
823
829
  end
824
830
  end
825
831
 
@@ -829,7 +835,7 @@ describe "haml ugly mode" do
829
835
  html = %q{<input checked='checked' />}
830
836
  locals = {}
831
837
  options = {:format=>:xhtml}
832
- assert_ugly(haml, locals, options)
838
+ assert_haml(haml, locals, options)
833
839
  end
834
840
 
835
841
  specify "boolean attribute with HTML" do
@@ -837,7 +843,7 @@ describe "haml ugly mode" do
837
843
  html = %q{<input checked>}
838
844
  locals = {}
839
845
  options = {:format=>:html5}
840
- assert_ugly(haml, locals, options)
846
+ assert_haml(haml, locals, options)
841
847
  end
842
848
  end
843
849
 
@@ -848,7 +854,7 @@ describe "haml ugly mode" do
848
854
  <pre>Bar&#x000A;Baz</pre>}
849
855
  locals = {}
850
856
  options = {}
851
- assert_ugly(haml, locals, options)
857
+ assert_haml(haml, locals, options)
852
858
  end
853
859
 
854
860
  specify "inside a textarea tag" do
@@ -859,7 +865,7 @@ describe "haml ugly mode" do
859
865
  hello</textarea>}
860
866
  locals = {}
861
867
  options = {}
862
- assert_ugly(haml, locals, options)
868
+ assert_haml(haml, locals, options)
863
869
  end
864
870
 
865
871
  specify "inside a pre tag" do
@@ -870,7 +876,7 @@ hello</textarea>}
870
876
  hello</pre>}
871
877
  locals = {}
872
878
  options = {}
873
- assert_ugly(haml, locals, options)
879
+ assert_haml(haml, locals, options)
874
880
  end
875
881
  end
876
882
 
@@ -882,7 +888,7 @@ hello</pre>}
882
888
  html = %q{<li>hello</li><li>world</li><li>again</li>}
883
889
  locals = {}
884
890
  options = {}
885
- assert_ugly(haml, locals, options)
891
+ assert_haml(haml, locals, options)
886
892
  end
887
893
 
888
894
  specify "a tag with '>' appended and nested content" do
@@ -895,7 +901,7 @@ hello</pre>}
895
901
  </li><li>again</li>}
896
902
  locals = {}
897
903
  options = {}
898
- assert_ugly(haml, locals, options)
904
+ assert_haml(haml, locals, options)
899
905
  end
900
906
 
901
907
  specify "a tag with '<' appended" do
@@ -906,7 +912,7 @@ hello</pre>}
906
912
  world</p>}
907
913
  locals = {}
908
914
  options = {}
909
- assert_ugly(haml, locals, options)
915
+ assert_haml(haml, locals, options)
910
916
  end
911
917
  end
912
918
  end