Super-beginner easy points ruby question. I’m trying to learn some ruby by programming the Project Euler problems. So I have a test
class ProjectEuler_tests < Test::Unit::TestCase @solution = 123456 # Not the answer so as not to be a spoiler def test_problem_1 assert_equal(@solution, ProjectEuler1.new.solve) end end
But this doesn’t work, @solution is nil when the test runs. What is the proper way to assign it at the class scope?
Class constants in ruby start with an uppercase char: