Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use require_relative inplace of standard require if available.

  • Loading branch information...
commit 49fcd9da3dc1443a500308b0ef998c36faa7b45b 1 parent a085b6f
Ian Leitch authored

Showing 1 changed file with 39 additions and 29 deletions. Show diff stats Hide diff stats

  1. +39 29 lib/rspec/core.rb
68 lib/rspec/core.rb
... ... @@ -1,32 +1,42 @@
1   -require 'rspec/core/filter_manager'
2   -require 'rspec/core/dsl'
3   -require 'rspec/core/extensions'
4   -require 'rspec/core/load_path'
5   -require 'rspec/core/deprecation'
6   -require 'rspec/core/backward_compatibility'
7   -require 'rspec/core/reporter'
  1 +if Kernel.respond_to?(:require_relative)
  2 + def require_rspec(path)
  3 + require_relative path
  4 + end
  5 +else
  6 + def require_rspec(path)
  7 + require "rspec/#{path}"
  8 + end
  9 +end
  10 +
  11 +require_rspec 'core/filter_manager'
  12 +require_rspec 'core/dsl'
  13 +require_rspec 'core/extensions'
  14 +require_rspec 'core/load_path'
  15 +require_rspec 'core/deprecation'
  16 +require_rspec 'core/backward_compatibility'
  17 +require_rspec 'core/reporter'
8 18
9   -require 'rspec/core/metadata_hash_builder'
10   -require 'rspec/core/hooks'
11   -require 'rspec/core/subject'
12   -require 'rspec/core/let'
13   -require 'rspec/core/metadata'
14   -require 'rspec/core/pending'
  19 +require_rspec 'core/metadata_hash_builder'
  20 +require_rspec 'core/hooks'
  21 +require_rspec 'core/subject'
  22 +require_rspec 'core/let'
  23 +require_rspec 'core/metadata'
  24 +require_rspec 'core/pending'
15 25
16   -require 'rspec/core/world'
17   -require 'rspec/core/configuration'
18   -require 'rspec/core/project_initializer'
19   -require 'rspec/core/option_parser'
20   -require 'rspec/core/drb_options'
21   -require 'rspec/core/configuration_options'
22   -require 'rspec/core/command_line'
23   -require 'rspec/core/drb_command_line'
24   -require 'rspec/core/runner'
25   -require 'rspec/core/example'
26   -require 'rspec/core/shared_example_group'
27   -require 'rspec/core/example_group'
28   -require 'rspec/core/version'
29   -require 'rspec/core/errors'
  26 +require_rspec 'core/world'
  27 +require_rspec 'core/configuration'
  28 +require_rspec 'core/project_initializer'
  29 +require_rspec 'core/option_parser'
  30 +require_rspec 'core/drb_options'
  31 +require_rspec 'core/configuration_options'
  32 +require_rspec 'core/command_line'
  33 +require_rspec 'core/drb_command_line'
  34 +require_rspec 'core/runner'
  35 +require_rspec 'core/example'
  36 +require_rspec 'core/shared_example_group'
  37 +require_rspec 'core/example_group'
  38 +require_rspec 'core/version'
  39 +require_rspec 'core/errors'
30 40
31 41 module RSpec
32 42 autoload :Matchers, 'rspec/matchers'
@@ -91,5 +101,5 @@ module Core
91 101 end
92 102 end
93 103
94   -require 'rspec/core/backward_compatibility'
95   -require 'rspec/monkey'
  104 +require_rspec 'core/backward_compatibility'
  105 +require_rspec 'monkey'

0 comments on commit 49fcd9d

Please sign in to comment.
Something went wrong with that request. Please try again.