A super beginner easily points to a ruby question. I am trying to learn some rubies by programming Project Euler problems . Therefore i have a test
class ProjectEuler_tests < Test::Unit::TestCase
@solution = 123456
def test_problem_1
assert_equal(@solution, ProjectEuler1.new.solve)
end
end
But this does not work, @solution is the nil when the test runs. What is the correct way to assign it in a class scope?
source
share