mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Make script_test use values of the proper type for script environments.
This commit is contained in:
parent
73ea6dd6a9
commit
0bdf726c31
1 changed files with 8 additions and 2 deletions
|
@ -110,12 +110,12 @@ WARN
|
|||
|
||||
private
|
||||
|
||||
def resolve(str, opts = {}, environment = {})
|
||||
def resolve(str, opts = {}, environment = env)
|
||||
munge_filename opts
|
||||
eval(str, opts, environment).to_s
|
||||
end
|
||||
|
||||
def eval(str, opts = {}, environment = {})
|
||||
def eval(str, opts = {}, environment = env)
|
||||
munge_filename opts
|
||||
Sass::Script.parse(str, opts[:line] || 1,
|
||||
opts[:offset] || 0, opts[:filename]).perform(environment)
|
||||
|
@ -141,6 +141,12 @@ WARN
|
|||
$stderr = the_real_stderr
|
||||
end
|
||||
|
||||
def env(hash = {})
|
||||
env = Sass::Environment.new
|
||||
hash.each {|k, v| env.set_var(k, v)}
|
||||
env
|
||||
end
|
||||
|
||||
def test_number_printing
|
||||
assert_equal "1", eval("1")
|
||||
assert_equal "1", eval("1.0")
|
||||
|
|
Loading…
Add table
Reference in a new issue