views:

33

answers:

1

I'm brand new to Ruby testing and Google isn't helping.

Using Test/Unit, how can I print an instance variable, like

test "thing to happen" do
  do_stuff
  assert_equal "foo", @variable
  p @varible
end
+1  A: 

Ruby asserts can output messages to test runner console:

test "thing to happen" do
  do_stuff
  assert_equal "foo", @variable, "@variable is #{@variable} when: things to happen"
  p @varible
end
Gutzofter