test/test-users-guide.rb in erubis-2.6.6 vs test/test-users-guide.rb in erubis-2.7.0

- old
+ new

@@ -1,8 +1,8 @@ ### -### $Release: 2.6.6 $ -### copyright(c) 2006-2010 kuwata-lab.com all rights reserved. +### $Release: 2.7.0 $ +### copyright(c) 2006-2011 kuwata-lab.com all rights reserved. ### require "#{File.dirname(__FILE__)}/test.rb" @@ -26,9 +26,25 @@ @name = (caller()[0] =~ /`(.*?)'/) && $1 s = File.read(@filename) s =~ /\A\$ (.*?)\n/ command = $1 expected = $' + if ruby19? + case @name + when 'test_main_program1_result' + expected.sub!('["eruby", "items", "x", "_buf"]', '[:_buf, :eruby, :items, :x]') + when 'test_main_program2_result' + expected.sub!('["_context", "x", "_buf"]', '[:_buf, :x, :_context]') + end + elsif rubinius? + command.sub!(/^ruby\b/, 'rbx') + case @name + when 'test_main_program1_result' + expected.sub!('["eruby", "items", "x", "_buf"]', '["_buf", "eruby", "items", "x"]') + when 'test_main_program2_result' + expected.sub!('["_context", "x", "_buf"]', '["_buf", "x", "_context"]') + end + end result = `#{command}` assert_text_equal(expected, result) end