我是Ruby测试的新手,Google没有帮助。
使用Test / Unit,如何打印实例变量,如
test "thing to happen" do
do_stuff
assert_equal "foo", @variable
p @varible
end
答案 0 :(得分:1)
Ruby asserts可以输出消息来测试跑步者控制台:
test "thing to happen" do
do_stuff
assert_equal "foo", @variable, "@variable is #{@variable} when: things to happen"
p @varible
end