Sha256: abd46c187b71816b912a537d83ef3db9838bce7ae719838cac22b893215a5292

Contents?: true

Size: 1.34 KB

Versions: 5

Compression:

Stored size: 1.34 KB

Contents

module RSpec
  module Core
    module ConstMissing
      def const_missing(name)
        case name
        when :Rspec, :Spec
          RSpec.warn_deprecation <<-WARNING
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.

#{caller(0)[2]}

* #{name} is deprecated.
* RSpec is the new top-level module in RSpec-2
*****************************************************************
WARNING
          RSpec
        else
          begin
            super
          rescue Exception => e
            e.backtrace.reject! {|l| l =~ Regexp.compile(__FILE__) }
            raise e
          end
        end
      end
    end
  end

  module Runner
    def self.configure(&block)
      RSpec.deprecate("Spec::Runner.configure", "RSpec.configure")
      RSpec.configure(&block)
    end
  end

  module Rake
    def self.const_missing(name)
      case name
      when :SpecTask
        RSpec.deprecate("Spec::Rake::SpecTask", "RSpec::Core::RakeTask")
        require 'rspec/core/rake_task'
        RSpec::Core::RakeTask
      else
        begin
          super
        rescue Exception => e
          e.backtrace.reject! {|l| l =~ Regexp.compile(__FILE__) }
          raise e
        end
      end
    end

  end
end

Object.extend(RSpec::Core::ConstMissing)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-core-2.7.0.rc1 lib/rspec/core/backward_compatibility.rb
rspec-core-2.6.4 lib/rspec/core/backward_compatibility.rb
rspec-core-2.6.3 lib/rspec/core/backward_compatibility.rb
rspec-core-2.6.3.beta1 lib/rspec/core/backward_compatibility.rb
rspec-core-2.6.2.rc lib/rspec/core/backward_compatibility.rb