@private Used internally to clear remaining groups when fail_fast is set
# File lib/rspec/core.rb, line 112 def self.clear_remaining_example_groups world.example_groups.clear end
Returns the global [Configuration](RSpec/Core/Configuration) object. While you can use this method to access the configuration, the more common convention is to use [RSpec.configure](RSpec#configure-class_method).
@example
RSpec.configuration.drb_port = 1234
@see ::configure @see Core::Configuration
# File lib/rspec/core.rb, line 80 def self.configuration if block_given? RSpec.warn_deprecation <<-WARNING ***************************************************************** DEPRECATION WARNING * RSpec.configuration with a block is deprecated and has no effect. * please use RSpec.configure with a block instead. Called from #{caller(0)[1]} ***************************************************************** WARNING end @configuration ||= RSpec::Core::Configuration.new end
Yields the global configuration to a block. @yield [Configuration] global configuration
@example
RSpec.configure do |config| config.add_formatter 'documentation' end
@see Core::Configuration
# File lib/rspec/core.rb, line 106 def self.configure yield configuration if block_given? end
# File lib/rspec/core.rb, line 129 def self.const_missing(name) case name when :Matchers # Load rspec-expectations when RSpec::Matchers is referenced. This allows # people to define custom matchers (using `RSpec::Matchers.define`) before # rspec-core has loaded rspec-expectations (since it delays the loading of # it to allow users to configure a different assertion/expectation # framework). `autoload` can't be used since it works with ruby's built-in # require (e.g. for files that are available relative to a load path dir), # but not with rubygems' extended require. require 'rspec/expectations' ::RSpec::Matchers else super end end
@private
Used internally to print deprecation warnings
# File lib/rspec/core/deprecation.rb, line 6 def deprecate(method, alternate_method=nil, version=nil) version_string = version ? "rspec-#{version}" : "a future version of RSpec" message = <<-NOTICE ***************************************************************** DEPRECATION WARNING: you are using deprecated behaviour that will be removed from #{version_string}. #{caller(0)[2]} * #{method} is deprecated. NOTICE if alternate_method message << <<-ADDITIONAL * please use #{alternate_method} instead. ADDITIONAL end message << "*****************************************************************" warn_deprecation(message) end
@private Used internally to ensure examples get reloaded between multiple runs in the same process.
# File lib/rspec/core.rb, line 67 def self.reset @world = nil @configuration = nil end
@private
# File lib/rspec/core.rb, line 47 def self.wants_to_quit # Used internally to determine what to do when a SIGINT is received world.wants_to_quit end
@private Used internally to determine what to do when a SIGINT is received
# File lib/rspec/core.rb, line 54 def self.wants_to_quit=(maybe) world.wants_to_quit=(maybe) end
@private
Used internally to print deprecation warnings
# File lib/rspec/core/deprecation.rb, line 32 def warn_deprecation(message) warn message end
@private
# File lib/rspec/core.rb, line 117 def self.windows_os? /mswin|mingw/ === ::RbConfig::CONFIG['host_os'] end
@private Internal container for global non-configuration data
# File lib/rspec/core.rb, line 60 def self.world @world ||= RSpec::Core::World.new end