Forgot to add a whole bunch of files.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@451 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
31387be9f9
commit
1f112ca018
|
@ -0,0 +1,20 @@
|
|||
# This file contains various useful bits of code
|
||||
# that are shared between Haml and Sass.
|
||||
|
||||
class Hash # :nodoc:
|
||||
# Same as Hash#merge!,
|
||||
# but recursively merges sub-hashes and arrays
|
||||
def rec_merge!(other)
|
||||
other.each do |key, value|
|
||||
myval = self[key]
|
||||
if value.is_a?(Hash) && myval.is_a?(Hash)
|
||||
myval.rec_merge!(value)
|
||||
elsif value.is_a?(Array) && myval.is_a?(Array)
|
||||
myval.concat(value)
|
||||
else
|
||||
self[key] = value
|
||||
end
|
||||
end
|
||||
self
|
||||
end
|
||||
end
|
|
@ -23,7 +23,7 @@ class SassPluginTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def teardown
|
||||
#File.delete(*Dir[tempfile_loc('*')])
|
||||
File.delete(*Dir[tempfile_loc('*')])
|
||||
end
|
||||
|
||||
def test_templates_should_render_correctly
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
imported { otherconst: hello; myconst: goodbye; }
|
||||
|
||||
body { font: Arial; background: blue; }
|
||||
|
||||
#page { width: 700px; height: 100; }
|
||||
#page #header { height: 300px; }
|
||||
#page #header h1 { font-size: 50px; color: blue; }
|
||||
|
||||
#content.user.show #container.top #column.left { width: 100px; }
|
||||
#content.user.show #container.top #column.right { width: 600px; }
|
||||
#content.user.show #container.bottom { background: brown; }
|
||||
|
||||
midrule { inthe: middle; }
|
||||
|
||||
body { font: Arial; background: blue; }
|
||||
|
||||
#page { width: 700px; height: 100; }
|
||||
#page #header { height: 300px; }
|
||||
#page #header h1 { font-size: 50px; color: blue; }
|
||||
|
||||
#content.user.show #container.top #column.left { width: 100px; }
|
||||
#content.user.show #container.top #column.right { width: 600px; }
|
||||
#content.user.show #container.bottom { background: brown; }
|
||||
|
||||
@import basic.css
|
||||
@import ../results/complex.css
|
||||
nonimported { myconst: hello; otherconst: goodbye; }
|
|
@ -0,0 +1,2 @@
|
|||
bork
|
||||
:bork: bork;
|
|
@ -0,0 +1,8 @@
|
|||
!preconst = hello
|
||||
|
||||
@import importee, basic, basic.css, ../results/complex.css
|
||||
|
||||
nonimported
|
||||
:myconst = !preconst
|
||||
:otherconst = !postconst
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
!postconst = goodbye
|
||||
|
||||
imported
|
||||
:otherconst = !preconst
|
||||
:myconst = !postconst
|
||||
|
||||
@import basic
|
||||
|
||||
midrule
|
||||
:inthe middle
|
Loading…
Reference in New Issue