title: Require paths for rspec tests in a Ruby Gem
body: <p>I am creating a simple Ruby Gem which is currently laid out as per the example in the <a href="http://guides.rubygems.org/make-your-own-gem/#requiring-more-files" rel="nofollow noreferrer">Making your own gem</a> documentation.</p>
  
  <p>My directory structure:</p>
  
  <pre><code>.
  ├── Gemfile
  ├── Gemfile.lock
  ├── lib
  │   ├── go_run
  │   │   ├── parser.rb
  │   │   └── runner.rb
  │   └── go_run.rb
  └── spec
      ├── go_run_spec.rb
      ├── parser_spec.rb
      └── runner_spec.rb
  </code></pre>
  
  <p>I originally called the <code>Runner</code> class in <code>lib/go_run/runner.rb</code> just <code>Runner</code>, but now, as per the documented example I have namespaced it under <code>GoRun::Runner</code>. The code works. The problem is that now running <code>bundle exec rspec spec/parser_spec.rb</code> does not. It fails with:</p>
  
  <pre><code>/home/smurf/dev/ruby/go_run/lib/go_run/parser.rb:3:in `&lt;top (required)&gt;': uninitialized constant GoRun (NameError)
  </code></pre>
  
  <p>The 3rd line of that file is:</p>
  
  <pre><code>class GoRun::Parser
  </code></pre>
  
  <p>I am <code>require</code>ing the library code in <code>spec/parser_spec.rb</code> using <code>require 'go_run/parser'</code>.</p>
  
  <p>I tried including it with <code>require_relative '../lib/go_run/parser'</code>, but that produced the same error.</p>
  
  <p>Does anybody know what I am doing wrong?</p>
  
  <p><strong>Update:</strong> I have uploaded the complete code on this branch: <a href="https://github.com/henrytk/go_run/tree/stackoverflow-43155117" rel="nofollow noreferrer">https://github.com/henrytk/go_run/tree/stackoverflow-43155117</a></p>