Wrote a simple program decided, check out MiniTest this program.
require 'minitest/autorun' class Test1 attr_accessor :x def z "Hello #{@x}" end end class Test2<MiniTest::Test def test_h @xx=Test1.new @xx.x="World" puts assert_equal "Hello World",@xx.z end end MiniTest does not generate errors, but when I added the puts statement, here is an example of code, it gives me an error.
require 'minitest/autorun' class Test1 attr_accessor :x def z puts "Hello #{@x}" end end class Test2<MiniTest::Test def test_h @xx=Test1.new @xx.x="World" puts assert_equal "Hello World",@xx.z end end What to do in the code so that MiniTest perceives puts ok?
putsnot an operator, but a method. Get into the habit of normally indenting so that you can visually select the body of a class and its individual methods. And what kind of error does it add if you addputs? - D-side