Sha256: da78b251eb14fb2e5243ee257e13c627767f1a5a10eaaaf21ee5d07f026f262f

Contents?: true

Size: 1.09 KB

Versions: 210

Compression:

Stored size: 1.09 KB

Contents

module RSpec
  module Expectations
    module DeprecatedConstants
      # Displays deprecation warning when it captures Rspec and Spec. Otherwise
      # delegates to super.
      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

    # @deprecated (no replacement)
    def differ=(ignore)
      RSpec.deprecate("RSpec::Expectations.differ=(differ)", "nothing at all (diffing is now automatic and no longer configurable)")
    end
  end
end

extend RSpec::Expectations::DeprecatedConstants

Version data entries

210 entries across 109 versions & 19 rubygems

Version Path
classiccms-0.6.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.6.1 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/expectations/extensions/object.rb
classiccms-0.6.0 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/expectations/extensions/object.rb
classiccms-0.6.0 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.6.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/expectations/extensions/object.rb
gem_repackager-0.1.0 support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.17 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.17 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.17 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.16 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.16 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.16 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.15 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.15 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.15 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.14 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.14 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.14 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.13 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/expectations/extensions/object.rb
classiccms-0.5.13 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/expectations/extensions/object.rb