Can't always access value of instance variable without @ even with attr_accessor
<p>How come I get the error <code>NoMethodError: undefined method '+' for nil:NilClass</code> but the line with <code>puts test</code> prints out a 1 so we know that the value is initialized?</p>

<pre><code>class TestClass
  attr_accessor :test
  def initialize()
    @test = 1
  end

  def testFn
    puts test
    test = test + 1
  end
end

t = TestClass.new
t.testFn
</code></pre>

<p>It also works if I change <code>test</code> to <code>@test</code> but I thought I didn't have to if I had <code>attr_accessor :test</code></p>