1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Sort specs

This commit is contained in:
Takashi Kokubun 2015-06-07 23:04:53 +09:00
parent 1191340cd1
commit 2eff6cca9c
5 changed files with 74 additions and 123 deletions

View file

@ -7,5 +7,4 @@ Showing incompatibilities against [Haml](https://github.com/haml/haml) and [Faml
- [engine/old\_attributes\_spec.rb](https://github.com/k0kubun/hamlit/blob/master/doc/engine/old_attributes.md)
- [engine/script\_spec.rb](https://github.com/k0kubun/hamlit/blob/master/doc/engine/script.md)
- [engine/tag\_spec.rb](https://github.com/k0kubun/hamlit/blob/master/doc/engine/tag.md)
- [engine/text\_spec.rb](https://github.com/k0kubun/hamlit/blob/master/doc/engine/text.md)

View file

@ -1,29 +0,0 @@
# [tag\_spec.rb:228](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/tag_spec.rb#L228)
## Input
```haml
%span!#{'<nyaa>'}
%span! #{'<nyaa>'}
!#{'<nyaa>'}
! #{'<nyaa>'}
```
## Output
### Haml
```html
<span><nyaa></span>
<span><nyaa></span>
!&lt;nyaa&gt;
<nyaa>
```
### Faml, Hamlit
```html
<span><nyaa></span>
<span><nyaa></span>
<nyaa>
<nyaa>
```

View file

@ -33,40 +33,37 @@ Haml::SyntaxError: Illegal element: classes and ids must have values.
```
# [text\_spec.rb:74](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/text_spec.rb#L74)
# [text\_spec.rb:113](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/text_spec.rb#L113)
## Input
```haml
aaa#{'<a>'}
!aaa#{'<a>'}
! aaa#{'<a>'}
! aaa#{'<a>'}
!!aa
%span!#{'<nyaa>'}
%span! #{'<nyaa>'}
!#{'<nyaa>'}
! #{'<nyaa>'}
```
## Output
### Haml
```html
aaa&lt;a&gt;
!aaa&lt;a&gt;
aaa<a>
aaa<a>
!!aa
<span><nyaa></span>
<span><nyaa></span>
!&lt;nyaa&gt;
<nyaa>
```
### Faml, Hamlit
```html
aaa&lt;a&gt;
aaa<a>
aaa<a>
aaa<a>
!aa
<span><nyaa></span>
<span><nyaa></span>
<nyaa>
<nyaa>
```
# [text\_spec.rb:93](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/text_spec.rb#L93)
# [text\_spec.rb:139](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/text_spec.rb#L139)
## Input
```haml
1#{2

View file

@ -186,68 +186,6 @@ describe Hamlit::Engine do
HTML
end
describe 'inline operator' do
it 'does not accept backslash operator' do
assert_render(<<-'HAML', <<-'HTML')
%span\ foo
HAML
<span>\ foo</span>
HTML
end
it 'accepts != operator' do
assert_render(<<-'HAML', <<-'HTML')
%span!= '<nyaa>'
HAML
<span><nyaa></span>
HTML
end
it 'accepts !== operator' do
assert_render(<<-'HAML', <<-'HTML')
%span!==#{'<nyaa>'}
%span!== #{'<nyaa>'}
!==#{'<nyaa>'}
!== #{'<nyaa>'}
HAML
<span><nyaa></span>
<span><nyaa></span>
<nyaa>
<nyaa>
HTML
end
it 'accepts &= operator' do
assert_render(<<-'HAML', <<-'HTML', escape_html: false)
%span&= '<nyaa>'
HAML
<span>&lt;nyaa&gt;</span>
HTML
end
it 'accepts ! operator' do
assert_render(<<-'HAML', <<-'HTML', compatible_only: :faml)
%span!#{'<nyaa>'}
%span! #{'<nyaa>'}
!#{'<nyaa>'}
! #{'<nyaa>'}
HAML
<span><nyaa></span>
<span><nyaa></span>
<nyaa>
<nyaa>
HTML
end
it 'accepts ~ operator' do
assert_render(<<-HAML, <<-HTML, escape_html: false)
%span~ 1
HAML
<span>1</span>
HTML
end
end
describe 'whitespace removal' do
it 'removes outer whitespace by >' do
assert_render(<<-HAML, <<-HTML)

View file

@ -71,20 +71,66 @@ describe Hamlit::Engine do
expect(render_string('\ a')).to eq(" a\n")
end
it 'renders ! operator' do
assert_render(<<-'HAML', <<-HTML, compatible_only: :faml)
aaa#{'<a>'}
!aaa#{'<a>'}
! aaa#{'<a>'}
! aaa#{'<a>'}
!!aa
HAML
aaa&lt;a&gt;
aaa<a>
aaa<a>
aaa<a>
!aa
HTML
describe 'inline operator' do
it 'does not accept backslash operator' do
assert_render(<<-'HAML', <<-'HTML')
%span\ foo
HAML
<span>\ foo</span>
HTML
end
it 'accepts != operator' do
assert_render(<<-'HAML', <<-'HTML')
%span!= '<nyaa>'
HAML
<span><nyaa></span>
HTML
end
it 'accepts !== operator' do
assert_render(<<-'HAML', <<-'HTML')
%span!==#{'<nyaa>'}
%span!== #{'<nyaa>'}
!==#{'<nyaa>'}
!== #{'<nyaa>'}
HAML
<span><nyaa></span>
<span><nyaa></span>
<nyaa>
<nyaa>
HTML
end
it 'accepts &= operator' do
assert_render(<<-'HAML', <<-'HTML', escape_html: false)
%span&= '<nyaa>'
HAML
<span>&lt;nyaa&gt;</span>
HTML
end
it 'accepts ! operator' do
assert_render(<<-'HAML', <<-'HTML', compatible_only: :faml)
%span!#{'<nyaa>'}
%span! #{'<nyaa>'}
!#{'<nyaa>'}
! #{'<nyaa>'}
HAML
<span><nyaa></span>
<span><nyaa></span>
<nyaa>
<nyaa>
HTML
end
it 'accepts ~ operator' do
assert_render(<<-HAML, <<-HTML, escape_html: false)
%span~ 1
HAML
<span>1</span>
HTML
end
end
describe 'string interpolation' do