From 3f244090934be5d49457266f8929bfbd011043fa Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 4 Jan 2017 21:35:50 +0200 Subject: [PATCH] us the actual classes for expected results If i remember strings were only used to shorten the names Now in register module this is not neccessary --- test/register/interpreter/helper.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/register/interpreter/helper.rb b/test/register/interpreter/helper.rb index c1129506..be198777 100644 --- a/test/register/interpreter/helper.rb +++ b/test/register/interpreter/helper.rb @@ -9,8 +9,8 @@ module Register Register.machine.boot do_clean_compile Typed.compile( @input ) - Register::Collector.collect_space - @interpreter = Register::Interpreter.new + Collector.collect_space + @interpreter = Interpreter.new @interpreter.start Register.machine.init end @@ -21,7 +21,7 @@ module Register def check_chain should should.each_with_index do |name , index| got = ticks(1) - assert got.class.name.index(name) , "Wrong class for #{index+1}, expect #{name} , got #{got}" + assert_equal got.class ,name , "Wrong class for #{index+1}, expect #{name} , got #{got}" end end @@ -54,11 +54,11 @@ module Register puts e puts e.backtrace end - classes = classes.collect {|c| '"' + c.name.sub("Register::","") + '",' } - classes << "length = #{classes.length}" - classes.each_slice(5).each do |line| - puts " " + line.join + str = classes.to_s.gsub("Register::","") + str.split(",").each_slice(5).each do |line| + puts " " + line.join(",") + "," end + puts "length = #{classes.length}" exit(1) end end