Sha256: 1f62b3ac0cee76c1a91f3ce61c079b4706eed3ffe6b63deb816480faeabd2f7b

Contents?: true

Size: 892 Bytes

Versions: 13

Compression:

Stored size: 892 Bytes

Contents

module RSpec
  class << self
    # @private
    #
    # Used internally to print deprecation warnings
    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 print deprecation warnings
    def warn_deprecation(message)
      send :warn, message
    end
  end
end

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/deprecation.rb
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/deprecation.rb
remq-0.0.4 vendor/bundle/gems/rspec-core-2.12.2/lib/rspec/core/deprecation.rb
remq-0.0.3 vendor/bundle/gems/rspec-core-2.12.2/lib/rspec/core/deprecation.rb
rspec-core-2.12.2 lib/rspec/core/deprecation.rb
rspec-core-2.12.1 lib/rspec/core/deprecation.rb
rspec-core-2.12.0 lib/rspec/core/deprecation.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/deprecation.rb
gem_repackager-0.1.0 support/gems/rspec-core-2.11.1/lib/rspec/core/deprecation.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/deprecation.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/deprecation.rb
rspec-core-2.11.1 lib/rspec/core/deprecation.rb
rspec-core-2.11.0 lib/rspec/core/deprecation.rb