change x= to *=, add unit tests and improve existing tests

This commit is contained in:
Clarence "Sparr" Risher
2017-10-05 19:41:43 -04:00
committed by Andy Meneely
parent b3bd8f03d8
commit 8509ab5728
4 changed files with 17 additions and 8 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ module Squib
add_parent_child(parent_val, child_val)
elsif child_val.to_s.strip.start_with?('-=')
sub_parent_child(parent_val, child_val)
elsif child_val.to_s.strip.start_with?('x=')
elsif child_val.to_s.strip.start_with?('*=')
mul_parent_child(parent_val, child_val)
elsif child_val.to_s.strip.start_with?('/=')
div_parent_child(parent_val, child_val)
@@ -82,7 +82,7 @@ module Squib
def mul_parent_child(parent, child)
parent_pixels = Args::UnitConversion.parse(parent, @dpi).to_f
child_float = child.sub('x=', '').to_f
child_float = child.sub('*=', '').to_f
parent_pixels * child_float
end