haml 1.5.2 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of haml might be problematic. Click here for more details.
- data/MIT-LICENSE +1 -1
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/css2sass +7 -0
- data/bin/html2haml +0 -82
- data/lib/haml.rb +43 -6
- data/lib/haml/buffer.rb +81 -72
- data/lib/haml/engine.rb +240 -110
- data/lib/haml/exec.rb +120 -5
- data/lib/haml/helpers.rb +88 -3
- data/lib/haml/helpers/action_view_extensions.rb +45 -0
- data/lib/haml/helpers/action_view_mods.rb +30 -17
- data/lib/haml/html.rb +173 -0
- data/lib/haml/template.rb +1 -26
- data/lib/haml/util.rb +18 -0
- data/lib/sass.rb +181 -3
- data/lib/sass/constant.rb +38 -9
- data/lib/sass/constant/color.rb +25 -1
- data/lib/sass/constant/literal.rb +10 -8
- data/lib/sass/css.rb +197 -0
- data/lib/sass/engine.rb +239 -68
- data/lib/sass/error.rb +2 -2
- data/lib/sass/plugin.rb +11 -3
- data/lib/sass/tree/attr_node.rb +25 -17
- data/lib/sass/tree/comment_node.rb +14 -0
- data/lib/sass/tree/node.rb +18 -1
- data/lib/sass/tree/rule_node.rb +17 -5
- data/lib/sass/tree/value_node.rb +4 -0
- data/test/haml/engine_test.rb +42 -25
- data/test/haml/helper_test.rb +28 -3
- data/test/haml/results/eval_suppressed.xhtml +6 -0
- data/test/haml/results/helpers.xhtml +26 -2
- data/test/haml/results/helpful.xhtml +2 -0
- data/test/haml/results/just_stuff.xhtml +17 -2
- data/test/haml/results/standard.xhtml +1 -1
- data/test/haml/results/whitespace_handling.xhtml +1 -11
- data/test/haml/rhtml/standard.rhtml +1 -1
- data/test/haml/template_test.rb +7 -2
- data/test/haml/templates/eval_suppressed.haml +7 -2
- data/test/haml/templates/helpers.haml +16 -1
- data/test/haml/templates/helpful.haml +2 -0
- data/test/haml/templates/just_stuff.haml +23 -4
- data/test/haml/templates/standard.haml +3 -3
- data/test/haml/templates/whitespace_handling.haml +0 -50
- data/test/sass/engine_test.rb +35 -10
- data/test/sass/plugin_test.rb +10 -6
- data/test/sass/results/alt.css +4 -0
- data/test/sass/results/complex.css +4 -3
- data/test/sass/results/constants.css +3 -3
- data/test/sass/results/import.css +27 -0
- data/test/sass/results/nested.css +7 -0
- data/test/sass/results/parent_ref.css +13 -0
- data/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
- data/test/sass/results/subdir/subdir.css +1 -0
- data/test/sass/templates/alt.sass +16 -0
- data/test/sass/templates/bork2.sass +2 -0
- data/test/sass/templates/complex.sass +19 -1
- data/test/sass/templates/constants.sass +8 -0
- data/test/sass/templates/import.sass +8 -0
- data/test/sass/templates/importee.sass +10 -0
- data/test/sass/templates/nested.sass +8 -0
- data/test/sass/templates/parent_ref.sass +25 -0
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
- data/test/sass/templates/subdir/subdir.sass +6 -0
- metadata +95 -75
- data/test/haml/results/semantic.cache +0 -15
@@ -41,5 +41,20 @@ stuff followed by whitespace
|
|
41
41
|
Woah a period.
|
42
42
|
<![endif]-->
|
43
43
|
testtest
|
44
|
-
<
|
45
|
-
<foo />
|
44
|
+
<br />
|
45
|
+
<meta foo='bar' />
|
46
|
+
<img />
|
47
|
+
<script />
|
48
|
+
<hr />
|
49
|
+
<link />
|
50
|
+
<script>Inline content</script>
|
51
|
+
<br>
|
52
|
+
Nested content
|
53
|
+
</br>
|
54
|
+
<p class='article bar foo' id='article_1'>Blah</p>
|
55
|
+
<p class='article foo' id='article_1'>Blah</p>
|
56
|
+
<p class='article quux qux' id='article_1'>Blump</p>
|
57
|
+
Woah inner quotes
|
58
|
+
<p class='dynamic_quote' dyn='3' quotes="single '">
|
59
|
+
</p>
|
60
|
+
<p class='dynamic_atomic' dyn='3' />
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html xml
|
2
|
+
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
|
3
3
|
<head>
|
4
4
|
<title>Hampton Catlin Is Totally Awesome</title>
|
5
5
|
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
|
@@ -33,21 +33,11 @@
|
|
33
33
|
foo
|
34
34
|
bar
|
35
35
|
</p>
|
36
|
-
<pre>
 ___
 ,o88888
 ,o8888888'
 ,:o:o:oooo. ,8O88Pd8888"
 ,.::.::o:ooooOoOoO. ,oO8O8Pd888'"
 ,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O"
 , ..:.::o:ooOoOOOO8OOOOo.FdO8O8"
 , ..:.::o:ooOoOO8O888O8O,COCOO"
 , . ..:.::o:ooOoOOOO8OOOOCOCO"
 . ..:.::o:ooOoOoOO8O8OCCCC"o
 . ..:.::o:ooooOoCoCCC"o:o
 . ..:.::o:o:,cooooCo"oo:o:
 ` . . ..:.:cocoooo"'o:o:::'
 .` . ..::ccccoc"'o:o:o:::'
 :.:. ,c:cccc"':.:.:.:.:.'
 ..:.:"'`::::c:"'..:.:.:.:.:.' http://www.chris.com/ASCII/
 ...:.'.:.::::"' . . . . .'
 .. . ....:."' ` . . . ''
 . . . ...."'
 .. . ."' -hrr-
 .


 It's a planet!
%strong This shouldn't be bold!
</pre>
|
37
|
-
<strong>This should!</strong>
|
38
|
-
<textarea>
|
39
|
-
___ ___ ___ ___ 
 /\__\ /\ \ /\__\ /\__\
 /:/ / /::\ \ /::| | /:/ /
 /:/__/ /:/\:\ \ /:|:| | /:/ / 
 /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ / 
 /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/ 
 \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \ 
 \::/ / \::/ / /:/ / \:\ \ 
 /:/ / /:/ / /:/ / \:\ \ 
 /:/ / /:/ / /:/ / \:\__\
 \/__/ \/__/ \/__/ \/__/

 Many
 thanks
 to
 http://www.network-science.de/ascii/

|
40
|
-
<strong>indeed!</strong>
|
41
|
-
</textarea>
|
42
36
|
</div>
|
43
37
|
<div class='foo'>
|
44
38
|
13
|
45
39
|
<textarea>
a
</textarea><textarea>
b
</textarea><textarea>
c
</textarea>
|
46
40
|
</div>
|
47
|
-
<pre>
|
48
|
-
foo

|
49
|
-
bar
|
50
|
-
</pre>
|
51
41
|
<div id='whitespace_test'>
|
52
42
|
<div class='text_area_test_area'>
|
53
43
|
<textarea>Oneline</textarea>
|
@@ -101,4 +91,4 @@ foo

|
|
101
91
|
<pre>
|
102
92
|
foo

|
103
93
|
bar
|
104
|
-
</pre>
|
94
|
+
</pre>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html xml
|
2
|
+
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en-US'>
|
3
3
|
<head>
|
4
4
|
<title>Hampton Catlin Is Totally Awesome</title>
|
5
5
|
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
|
data/test/haml/template_test.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'rubygems'
|
5
5
|
require 'active_support'
|
6
|
+
require 'action_controller'
|
6
7
|
require 'action_view'
|
7
8
|
|
8
9
|
require File.dirname(__FILE__) + '/../../lib/haml'
|
@@ -45,11 +46,15 @@ class TemplateTest < Test::Unit::TestCase
|
|
45
46
|
test = Proc.new do |rendered|
|
46
47
|
load_result(name).split("\n").zip(rendered.split("\n")).each_with_index do |pair, line|
|
47
48
|
message = "template: #{name}\nline: #{line}"
|
48
|
-
assert_equal(pair.
|
49
|
+
assert_equal(pair.first, pair.last, message)
|
49
50
|
end
|
50
51
|
end
|
51
52
|
test.call(@base.render(name))
|
52
|
-
|
53
|
+
|
54
|
+
# If eval's suppressed, the partial won't render anyway :p.
|
55
|
+
unless Haml::Template.options[:suppress_eval]
|
56
|
+
test.call(@base.render(:file => "partialize", :locals => { :name => name }))
|
57
|
+
end
|
53
58
|
end
|
54
59
|
|
55
60
|
def test_empty_render_should_remain_empty
|
@@ -36,7 +36,8 @@ click
|
|
36
36
|
- concat "foo\n"
|
37
37
|
- buffer.tabulation = 0
|
38
38
|
- def url_for(*stuff); stuff.join(' '); end
|
39
|
-
|
39
|
+
%p
|
40
|
+
= form_tag 'hello/world'
|
40
41
|
- form_tag 'heeheeaform' do
|
41
42
|
%div= submit_tag 'save'
|
42
43
|
- form_for :article, @article, :url => 'article_url' do |f|
|
@@ -46,3 +47,17 @@ click
|
|
46
47
|
= f.text_field :body
|
47
48
|
= list_of({:google => 'http://www.google.com'}) do |name, link|
|
48
49
|
%a{ :href => link }= name
|
50
|
+
%p
|
51
|
+
- puts "foo"
|
52
|
+
%div
|
53
|
+
- puts "bar"
|
54
|
+
- puts "boom"
|
55
|
+
baz
|
56
|
+
- puts "boom, again"
|
57
|
+
- open :table do
|
58
|
+
- open :tr do
|
59
|
+
- open :td, {:class => 'cell'} do
|
60
|
+
- open :strong, "strong!"
|
61
|
+
- puts "data"
|
62
|
+
- open :td do
|
63
|
+
- puts "more_data"
|
@@ -29,6 +29,10 @@
|
|
29
29
|
cool, huh?
|
30
30
|
%strong there can even be sub-tags!
|
31
31
|
= "Or script!"
|
32
|
+
-# Haml comment
|
33
|
+
-#
|
34
|
+
Nested Haml comment
|
35
|
+
- raise 'dead'
|
32
36
|
%p{ :class => "" } class attribute shouldn't appear!
|
33
37
|
/[if lte IE6] conditional comment!
|
34
38
|
/[if gte IE7]
|
@@ -39,13 +43,28 @@
|
|
39
43
|
Woah a period.
|
40
44
|
= "test" |
|
41
45
|
"test" |
|
46
|
+
-# Hard tabs shouldn't throw errors.
|
47
|
+
|
42
48
|
- case :foo
|
43
49
|
- when :bar
|
44
|
-
%
|
50
|
+
%br Blah
|
45
51
|
- when :foo
|
46
|
-
%
|
52
|
+
%br
|
47
53
|
- case :foo
|
48
54
|
- when :bar
|
49
|
-
%
|
55
|
+
%meta{ :foo => 'blah'}
|
50
56
|
- when :foo
|
51
|
-
%foo
|
57
|
+
%meta{ :foo => 'bar'}
|
58
|
+
%img
|
59
|
+
%script
|
60
|
+
%hr
|
61
|
+
%link
|
62
|
+
%script Inline content
|
63
|
+
%br
|
64
|
+
Nested content
|
65
|
+
%p.foo{:class => true ? 'bar' : 'baz'}[@article] Blah
|
66
|
+
%p.foo{:class => false ? 'bar' : ''}[@article] Blah
|
67
|
+
%p.qux{:class => 'quux'}[@article] Blump
|
68
|
+
== #{"Woah inner quotes"}
|
69
|
+
%p.dynamic_quote{:quotes => "single '", :dyn => 1 + 2}
|
70
|
+
%p.dynamic_atomic{:dyn => 1 + 2}/
|
@@ -1,8 +1,8 @@
|
|
1
1
|
!!!
|
2
|
-
%html{
|
2
|
+
%html{html_attrs}
|
3
3
|
%head
|
4
4
|
%title Hampton Catlin Is Totally Awesome
|
5
|
-
%meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}
|
5
|
+
%meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}
|
6
6
|
%body
|
7
7
|
/ You're In my house now!
|
8
8
|
- concat("foo\n")
|
@@ -15,7 +15,7 @@
|
|
15
15
|
- 120.times do |number|
|
16
16
|
- number
|
17
17
|
Wow.|
|
18
|
-
%p
|
18
|
+
%p
|
19
19
|
= "Holy cow " + |
|
20
20
|
"multiline " + |
|
21
21
|
"tags! " + |
|
@@ -10,60 +10,10 @@
|
|
10
10
|
~ "<pre>foo\nbar</pre>"
|
11
11
|
%p~ "<pre>foo\nbar</pre>"
|
12
12
|
%p~ "foo\nbar"
|
13
|
-
%pre~
|
14
|
-
___
|
15
|
-
,o88888
|
16
|
-
,o8888888'
|
17
|
-
,:o:o:oooo. ,8O88Pd8888"
|
18
|
-
,.::.::o:ooooOoOoO. ,oO8O8Pd888'"
|
19
|
-
,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O"
|
20
|
-
, ..:.::o:ooOoOOOO8OOOOo.FdO8O8"
|
21
|
-
, ..:.::o:ooOoOO8O888O8O,COCOO"
|
22
|
-
, . ..:.::o:ooOoOOOO8OOOOCOCO"
|
23
|
-
. ..:.::o:ooOoOoOO8O8OCCCC"o
|
24
|
-
. ..:.::o:ooooOoCoCCC"o:o
|
25
|
-
. ..:.::o:o:,cooooCo"oo:o:
|
26
|
-
` . . ..:.:cocoooo"'o:o:::'
|
27
|
-
.` . ..::ccccoc"'o:o:o:::'
|
28
|
-
:.:. ,c:cccc"':.:.:.:.:.'
|
29
|
-
..:.:"'`::::c:"'..:.:.:.:.:.' http://www.chris.com/ASCII/
|
30
|
-
...:.'.:.::::"' . . . . .'
|
31
|
-
.. . ....:."' ` . . . ''
|
32
|
-
. . . ...."'
|
33
|
-
.. . ."' -hrr-
|
34
|
-
.
|
35
|
-
|
36
|
-
|
37
|
-
It's a planet!
|
38
|
-
%strong This shouldn't be bold!
|
39
|
-
%strong This should!
|
40
|
-
%textarea
|
41
|
-
~
|
42
|
-
___ ___ ___ ___
|
43
|
-
/\__\ /\ \ /\__\ /\__\
|
44
|
-
/:/ / /::\ \ /::| | /:/ /
|
45
|
-
/:/__/ /:/\:\ \ /:|:| | /:/ /
|
46
|
-
/::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ /
|
47
|
-
/:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/
|
48
|
-
\/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \
|
49
|
-
\::/ / \::/ / /:/ / \:\ \
|
50
|
-
/:/ / /:/ / /:/ / \:\ \
|
51
|
-
/:/ / /:/ / /:/ / \:\__\
|
52
|
-
\/__/ \/__/ \/__/ \/__/
|
53
|
-
|
54
|
-
Many
|
55
|
-
thanks
|
56
|
-
to
|
57
|
-
http://www.network-science.de/ascii/
|
58
|
-
%strong indeed!
|
59
13
|
.foo
|
60
14
|
~ 13
|
61
15
|
~ ['a', 'b', 'c'].map do |a|
|
62
16
|
- "<textarea>\n#{a}\n</textarea>"
|
63
|
-
%pre
|
64
|
-
~
|
65
|
-
foo
|
66
|
-
bar
|
67
17
|
#whitespace_test
|
68
18
|
= render :file => "_text_area.haml", :locals => { :value => "Oneline" }
|
69
19
|
= render :file => "_text_area.haml", :locals => { :value => "Two\nlines" }
|
data/test/sass/engine_test.rb
CHANGED
@@ -9,10 +9,10 @@ class SassEngineTest < Test::Unit::TestCase
|
|
9
9
|
"!a = 1 + " => 'Constant arithmetic error: "1 +"',
|
10
10
|
"!a = 1 + 2 +" => 'Constant arithmetic error: "1 + 2 +"',
|
11
11
|
"!a = \"b" => 'Unterminated string: "\\"b"',
|
12
|
-
"!a = #aaa - a" => 'Undefined operation: "#
|
13
|
-
"!a = #aaa / a" => 'Undefined operation: "#
|
14
|
-
"!a = #aaa * a" => 'Undefined operation: "#
|
15
|
-
"!a = #aaa % a" => 'Undefined operation: "#
|
12
|
+
"!a = #aaa - a" => 'Undefined operation: "#aaaaaa minus a"',
|
13
|
+
"!a = #aaa / a" => 'Undefined operation: "#aaaaaa div a"',
|
14
|
+
"!a = #aaa * a" => 'Undefined operation: "#aaaaaa times a"',
|
15
|
+
"!a = #aaa % a" => 'Undefined operation: "#aaaaaa mod a"',
|
16
16
|
"!a = 1 - a" => 'Undefined operation: "1 minus a"',
|
17
17
|
"!a = 1 * a" => 'Undefined operation: "1 times a"',
|
18
18
|
"!a = 1 / a" => 'Undefined operation: "1 div a"',
|
@@ -21,8 +21,12 @@ class SassEngineTest < Test::Unit::TestCase
|
|
21
21
|
": a" => 'Invalid attribute: ": a"',
|
22
22
|
":= a" => 'Invalid attribute: ":= a"',
|
23
23
|
"a\n :b" => 'Invalid attribute: ":b "',
|
24
|
-
"a\n :b: c" => 'Invalid attribute: ":b: c"
|
24
|
+
"a\n :b: c" => 'Invalid attribute: ":b: c"',
|
25
|
+
"a\n :b:c d" => 'Invalid attribute: ":b:c d"',
|
26
|
+
"a\n :b=c d" => 'Invalid attribute: ":b=c d"',
|
25
27
|
"a\n :b c;" => 'Invalid attribute: ":b c;" (This isn\'t CSS!)',
|
28
|
+
"a\n b : c" => 'Invalid attribute: "b : c"',
|
29
|
+
"a\n b=c: d" => 'Invalid attribute: "b=c: d"',
|
26
30
|
":a" => 'Attributes aren\'t allowed at the root of a document.',
|
27
31
|
"!" => 'Invalid constant: "!"',
|
28
32
|
"!a" => 'Invalid constant: "!a"',
|
@@ -31,8 +35,15 @@ class SassEngineTest < Test::Unit::TestCase
|
|
31
35
|
"a\n\t:b c" => "Illegal Indentation: Only two space characters are allowed as tabulation.",
|
32
36
|
"a\n :b c" => "Illegal Indentation: Only two space characters are allowed as tabulation.",
|
33
37
|
"a\n :b c" => "Illegal Indentation: Only two space characters are allowed as tabulation.",
|
34
|
-
"a\n :b\n !
|
35
|
-
"!a = 1b + 2c" => "Incompatible units: b and c"
|
38
|
+
"a\n :b c\n !d = 3" => "Constants may only be declared at the root of a document.",
|
39
|
+
"!a = 1b + 2c" => "Incompatible units: b and c",
|
40
|
+
"& a\n :b c" => "Base-level rules cannot contain the parent-selector-referencing character '&'",
|
41
|
+
"a\n :b\n c" => "Illegal nesting: Only attributes may be nested beneath attributes.",
|
42
|
+
"!a = b\n :c d\n" => "Illegal nesting: Nothing may be nested beneath constants.",
|
43
|
+
"@import foo.sass" => "File to import not found or unreadable: foo.sass",
|
44
|
+
"@import templates/basic\n foo" => "Illegal nesting: Nothing may be nested beneath import directives.",
|
45
|
+
"foo\n @import templates/basic" => "Import directives may only be used at the root of a document.",
|
46
|
+
"@foo bar boom" => "Unknown compiler directive: \"@foo bar boom\"",
|
36
47
|
}
|
37
48
|
|
38
49
|
def test_basic_render
|
@@ -54,21 +65,35 @@ class SassEngineTest < Test::Unit::TestCase
|
|
54
65
|
assert(err.sass_line, "Line: #{key}")
|
55
66
|
assert_match(/\(sass\):[0-9]+/, err.backtrace[0], "Line: #{key}")
|
56
67
|
else
|
57
|
-
assert(false, "Exception not raised for
|
68
|
+
assert(false, "Exception not raised for\n#{key}")
|
58
69
|
end
|
59
70
|
end
|
60
71
|
end
|
61
72
|
|
62
73
|
def test_exception_line
|
63
|
-
to_render = "rule\n :attr val\n :broken\n"
|
74
|
+
to_render = "rule\n :attr val\n// comment!\n\n :broken\n"
|
64
75
|
begin
|
65
76
|
Sass::Engine.new(to_render).render
|
66
77
|
rescue Sass::SyntaxError => err
|
67
|
-
assert_equal(
|
78
|
+
assert_equal(5, err.sass_line)
|
68
79
|
else
|
69
80
|
assert(false, "Exception not raised for '#{to_render}'!")
|
70
81
|
end
|
71
82
|
end
|
83
|
+
|
84
|
+
def test_imported_exception
|
85
|
+
[1, 2].each do |i|
|
86
|
+
i = nil if i == 1
|
87
|
+
begin
|
88
|
+
Sass::Engine.new("@import bork#{i}", :load_paths => [File.dirname(__FILE__) + '/templates/']).render
|
89
|
+
rescue Sass::SyntaxError => err
|
90
|
+
assert_equal(2, err.sass_line)
|
91
|
+
assert_match(/bork#{i}\.sass$/, err.sass_filename)
|
92
|
+
else
|
93
|
+
assert(false, "Exception not raised for imported template: bork#{i}")
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
72
97
|
|
73
98
|
private
|
74
99
|
|
data/test/sass/plugin_test.rb
CHANGED
@@ -1,20 +1,24 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
RAILS_ENV = 'testing'
|
3
4
|
require 'test/unit'
|
5
|
+
require 'fileutils'
|
4
6
|
require File.dirname(__FILE__) + '/../../lib/sass'
|
5
|
-
|
6
|
-
RAILS_ENV = 'testing'
|
7
|
-
|
8
7
|
require 'sass/plugin'
|
9
8
|
|
10
9
|
class SassPluginTest < Test::Unit::TestCase
|
11
|
-
@@templates = %w{
|
10
|
+
@@templates = %w{
|
11
|
+
complex constants parent_ref import alt
|
12
|
+
subdir/subdir subdir/nested_subdir/nested_subdir
|
13
|
+
}
|
12
14
|
|
13
15
|
def setup
|
16
|
+
FileUtils.mkdir File.dirname(__FILE__) + '/tmp'
|
14
17
|
Sass::Plugin.options = {
|
15
18
|
:template_location => File.dirname(__FILE__) + '/templates',
|
16
19
|
:css_location => File.dirname(__FILE__) + '/tmp',
|
17
|
-
:style => :compact
|
20
|
+
:style => :compact,
|
21
|
+
:load_paths => [File.dirname(__FILE__) + '/results'],
|
18
22
|
}
|
19
23
|
Sass::Plugin.options[:always_update] = true
|
20
24
|
|
@@ -22,7 +26,7 @@ class SassPluginTest < Test::Unit::TestCase
|
|
22
26
|
end
|
23
27
|
|
24
28
|
def teardown
|
25
|
-
File.
|
29
|
+
FileUtils.rm_r File.dirname(__FILE__) + '/tmp'
|
26
30
|
end
|
27
31
|
|
28
32
|
def test_templates_should_render_correctly
|
@@ -17,6 +17,7 @@ body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-se
|
|
17
17
|
#menu { clear: both; text-align: right; height: 20px; border-bottom: 5px solid #006b95; background: #00a4e4; }
|
18
18
|
#menu .contests ul { margin: 0 5px 0 0; padding: 0; }
|
19
19
|
#menu .contests ul li { list-style-type: none; margin: 0 5px; padding: 5px 5px 0 5px; display: inline; font-size: 1.1em; color: #fff; background: #00a4e4; }
|
20
|
+
#menu .contests ul li / This rule isn't a comment! { red: green; }
|
20
21
|
#menu .contests a:link, #menu .contests a:visited { color: #fff; text-decoration: none; font-weight: bold; }
|
21
22
|
#menu .contests a:hover { text-decoration: underline; }
|
22
23
|
|
@@ -32,8 +33,8 @@ body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-se
|
|
32
33
|
#content .container.video .column.left { width: 200px; }
|
33
34
|
#content .container.video .column.left .box { margin-top: 10px; }
|
34
35
|
#content .container.video .column.left .box p { margin: 0 1em auto 1em; }
|
35
|
-
#content .container.video .column.left .box.participants img { float: left; margin: 0 1em auto 1em; border: 1px solid #6e000d; }
|
36
|
-
#content .container.video .column.left .box.participants h2 { margin: 0 0 10px 0; padding: 0.5em; background: #6e000d url(/images/hdr_participant.gif) 2px 2px no-repeat; text-indent: -9999px; border-top-width: 5px; border-top-style: solid; border-top-color: #a20013; border-right-width: 1px; border-right-style: dotted; }
|
36
|
+
#content .container.video .column.left .box.participants img { float: left; margin: 0 1em auto 1em; border: 1px solid #6e000d; border-style: solid; }
|
37
|
+
#content .container.video .column.left .box.participants h2 { margin: 0 0 10px 0; padding: 0.5em; /* The background image is a gif! */ background: #6e000d url(/images/hdr_participant.gif) 2px 2px no-repeat; /* Okay check this out Multiline comments Wow dude I mean seriously, WOW */ text-indent: -9999px; border-top-width: 5px; border-top-style: solid; border-top-color: #a20013; border-right-width: 1px; border-right-style: dotted; }
|
37
38
|
#content .container.video .column.middle { width: 500px; }
|
38
39
|
#content .container.video .column.right { width: 200px; }
|
39
40
|
#content .container.video .column.right .box { margin-top: 0; }
|
@@ -62,7 +63,7 @@ body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-se
|
|
62
63
|
#content .container.comments .column.left .box li { list-style-type: none; padding: 10px; margin: 0 0 1em 0; background: #6e000d; border-top: 5px solid #a20013; }
|
63
64
|
#content .container.comments .column.left .box li div { margin-bottom: 1em; }
|
64
65
|
#content .container.comments .column.left .box li ul { text-align: right; }
|
65
|
-
#content .container.comments .column.left .box li ul li { display: inline; border: none; padding: 0; }
|
66
|
+
#content .container.comments .column.left .box li ul li { display: inline; border: none; padding: 0; }
|
66
67
|
#content .container.comments .column.right { width: 290px; padding-left: 10px; }
|
67
68
|
#content .container.comments .column.right h2 { margin: 0; padding: 0.5em; background: #6e000d url(/images/hdr_addcomment.gif) 2px 2px no-repeat; text-indent: -9999px; border-top: 5px solid #a20013; }
|
68
69
|
#content .container.comments .column.right .box textarea { width: 290px; height: 100px; border: none; }
|
@@ -1,9 +1,9 @@
|
|
1
|
-
#main { content: Hello!; qstr: Quo"ted"!; hstr: Hyph-en!; width: 30em; background-color: #000; color: #
|
1
|
+
#main { content: Hello!; qstr: Quo"ted"!; hstr: Hyph-en!; width: 30em; background-color: #000; color: #ffffaa; short-color: #112233; named-color: #808000; con: foo bar 9 hi there boom; con2: noquo quo; }
|
2
2
|
#main #sidebar { background-color: #00ff98; num-normal: 10; num-dec: 10.2; num-dec0: 99; num-neg: -10; esc: 10+12; many: 6; order: 7; complex: #4c9db1hi16; }
|
3
3
|
|
4
|
-
#plus { num-num: 7; num-num-un: 25em; num-num-un2: 23em; num-num-neg: 9.87; num-str: 100px; num-col: #
|
4
|
+
#plus { num-num: 7; num-num-un: 25em; num-num-un2: 23em; num-num-neg: 9.87; num-str: 100px; num-col: #b7b7b7; num-perc: 31%; str-str: hi there; str-str2: hi there; str-col: 14em solid #112233; str-num: times: 13; col-num: #ff7b9d; col-col: #5173ff; }
|
5
5
|
|
6
|
-
#minus { num-num: 900; col-num: #f9f9f4; col-col: #000035; }
|
6
|
+
#minus { num-num: 900; col-num: #f9f9f4; col-col: #000035; unary-num: -1; unary-const: 10; unary-paren: -11; }
|
7
7
|
|
8
8
|
#times { num-num: 7; num-col: #7496b8; col-num: #092345; col-col: #243648; }
|
9
9
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
imported { otherconst: hello; myconst: goodbye; }
|
2
|
+
|
3
|
+
body { font: Arial; background: blue; }
|
4
|
+
|
5
|
+
#page { width: 700px; height: 100; }
|
6
|
+
#page #header { height: 300px; }
|
7
|
+
#page #header h1 { font-size: 50px; color: blue; }
|
8
|
+
|
9
|
+
#content.user.show #container.top #column.left { width: 100px; }
|
10
|
+
#content.user.show #container.top #column.right { width: 600px; }
|
11
|
+
#content.user.show #container.bottom { background: brown; }
|
12
|
+
|
13
|
+
midrule { inthe: middle; }
|
14
|
+
|
15
|
+
body { font: Arial; background: blue; }
|
16
|
+
|
17
|
+
#page { width: 700px; height: 100; }
|
18
|
+
#page #header { height: 300px; }
|
19
|
+
#page #header h1 { font-size: 50px; color: blue; }
|
20
|
+
|
21
|
+
#content.user.show #container.top #column.left { width: 100px; }
|
22
|
+
#content.user.show #container.top #column.right { width: 600px; }
|
23
|
+
#content.user.show #container.bottom { background: brown; }
|
24
|
+
|
25
|
+
@import basic.css
|
26
|
+
@import ../results/complex.css
|
27
|
+
nonimported { myconst: hello; otherconst: goodbye; }
|