module RSpec
def self.clear_remaining_example_groups
def self.clear_remaining_example_groups world.example_groups.clear end
def self.configuration
def self.configuration @configuration ||= RSpec::Core::Configuration.new end
def self.configure
def self.configure warn_about_deprecated_configure if RSpec.world.example_groups.any? yield configuration if block_given? end
def self.wants_to_quit
def self.wants_to_quit world.wants_to_quit end
def self.wants_to_quit=(maybe)
def self.wants_to_quit=(maybe) world.wants_to_quit=(maybe) end
def self.warn_about_deprecated_configure
def self.warn_about_deprecated_configure warn <<-NOTICE ************************************************************* ECATION WARNING: you are using deprecated behaviour that will emoved from RSpec 3. have set some configuration options after an example group has ady been defined. In RSpec 3, this will not be allowed. All iguration should happen before the first example group is ned. The configuration is happening at: caller[1]} ************************************************************* CE end
def self.world
def self.world @world ||= RSpec::Core::World.new end
def deprecate(method, alternate_method=nil, version=nil)
def deprecate(method, alternate_method=nil, version=nil) version_string = version ? "rspec-#{version}" : "a future version of RSpec" message = <<-NOTICE ************************************************************* ECATION WARNING: you are using deprecated behaviour that will emoved from #{version_string}. ller(0)[2]} method} is deprecated. CE if alternate_method message << <<-ADDITIONAL ease use #{alternate_method} instead. TIONAL end message << "*****************************************************************" warn_deprecation(message) end
def warn_deprecation(message)
def warn_deprecation(message) send :warn, message end