including files

My spec folder is setup like this:





My some_file_spec.rb has:

require ‘spec_helper’

describe “…” do


Why does this work even though the spec_helper file is in a folder below the actual file I am writing the specs for?

What techniques are there to include files? I see this also:

require File.expand_path(’…/boot’, FILE)

You could change your spec file to:

require ‘spec_helper’


describe “…” do

and study the output of that puts.

In my case, rather near the end of the list, it has:


which explains why the require finds the spec_helper.rb file there.