HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.6.8/spec/ruby/core/exception/load_error_spec.rb
require_relative '../../spec_helper'

describe "LoadError#path" do
  before :each do
    @le = LoadError.new
  end

  it "is nil when constructed directly" do
    @le.path.should == nil
  end
end

describe "LoadError raised by load or require" do
  it "provides the failing path in its #path attribute" do
    begin
      require 'file_that_does_not_exist'
    rescue LoadError => le
      le.path.should == 'file_that_does_not_exist'
    end
  end
end