diff --git a/lib/ruby/assignment_statement.rb b/lib/ruby/assignment_statement.rb index 05e4ec93..066fe4a5 100644 --- a/lib/ruby/assignment_statement.rb +++ b/lib/ruby/assignment_statement.rb @@ -23,8 +23,8 @@ module Ruby self.vool_brother.new(name,value) end - def to_vool_send - statements = value.normalize() + def normalize_send + statements = value.to_vool return copy( statements ) if statements.is_a?(Vool::SendStatement) assign = statements.statements.pop statements << copy(assign) diff --git a/test/ruby/test_ivar_assignment.rb b/test/ruby/test_ivar_assignment.rb index dda5f873..17473ffd 100644 --- a/test/ruby/test_ivar_assignment.rb +++ b/test/ruby/test_ivar_assignment.rb @@ -1,7 +1,7 @@ require_relative "helper" module Ruby - class TestIvarAssignment < MiniTest::Test + class TestAssignment < MiniTest::Test include RubyTests def test_local @@ -12,7 +12,6 @@ module Ruby lst = compile( "foo = bar") assert_equal :foo , lst.name end - def test_instance lst = compile( "@foo = bar") assert_equal IvarAssignment , lst.class @@ -21,12 +20,33 @@ module Ruby lst = compile( "@foo = bar") assert_equal :foo , lst.name end - def test_const lst = compile( "@foo = 5") assert_equal IvarAssignment , lst.class end + end + class TestAssignmentVool < MiniTest::Test + include RubyTests - + def test_local + lst = compile( "foo = bar").to_vool + assert_equal Vool::LocalAssignment , lst.class + end + def test_local_name + lst = compile( "foo = bar").to_vool + assert_equal :foo , lst.name + end + def test_instance + lst = compile( "@foo = bar").to_vool + assert_equal Vool::IvarAssignment , lst.class + end + def test_instance_name + lst = compile( "@foo = bar").to_vool + assert_equal :foo , lst.name + end + def test_const + lst = compile( "@foo = 5").to_vool + assert_equal Vool::IvarAssignment , lst.class + end end end