Sha256: 652c895646a31b0bf9f5d5d0ff64fb2dda47f4f25cd1bf20781c9c18f3209fb7

Contents?: true

Size: 1.59 KB

Versions: 12

Compression:

Stored size: 1.59 KB

Contents

module RSpec
  module Core
    module ConstMissing
      # Used to print deprecation warnings for Rspec and Spec constants (use
      # RSpec instead)
      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
    # @deprecated use RSpec.configure instead.
    def self.configure(&block)
      RSpec.deprecate("Spec::Runner.configure", "RSpec.configure")
      RSpec.configure(&block)
    end
  end

  module Rake
    # Used to print deprecation warnings for Rake::SpecTask constant (use
    # RSpec::Core::RakeTask instead)
    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

12 entries across 12 versions & 3 rubygems

Version Path
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb
rspec-core-2.8.0.rc1 lib/rspec/core/backward_compatibility.rb
rspec-core-2.7.1 lib/rspec/core/backward_compatibility.rb
rspec-core-2.7.0 lib/rspec/core/backward_compatibility.rb