Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 1bcb245328
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (23 sloc) 0.621 kB
require 'rubygems'
require 'bundler'
require 'minitest/autorun'
require 'require_relative'
class RequireRelativeTest < MiniTest::Unit::TestCase
# after each test we reset Ruby's internal list of required files, so that we
# can rerequire the ones we're testing with
def setup
@req_length = $".length
end
def teardown
$".pop($".length - @req_length)
end
def test_current_dir_not_in_load_path
assert_nil $:.detect{|i| i == "."}
end
def test_require_relative
assert require_relative('foo')
end
def test_require_relative_subdir
assert require_relative('subdir/bar')
end
end
Jump to Line
Something went wrong with that request. Please try again.