Sha256: 0a2479dc11f27916f24d726ba0f5872e83e2c4315e0ac90b1d2b508b7283c99f

Contents?: true

Size: 938 Bytes

Versions: 19

Compression:

Stored size: 938 Bytes

Contents

module RSpec

  # This is defined in rspec-core, but we can't assume it's loaded since
  # rspec-expectations should be usable w/o rspec-core.
  unless respond_to?(:deprecate)
    class << self
      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

      def warn_deprecation(message)
        send :warn, message
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rspec-expectations-2.5.0/lib/rspec/expectations/deprecation.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rspec-expectations-2.5.0/lib/rspec/expectations/deprecation.rb
rspec-expectations-2.6.0 lib/rspec/expectations/deprecation.rb
rspec-expectations-2.6.0.rc6 lib/rspec/expectations/deprecation.rb
rspec-expectations-2.6.0.rc4 lib/rspec/expectations/deprecation.rb
rspec-expectations-2.6.0.rc2 lib/rspec/expectations/deprecation.rb
rspec-expectations-2.5.0 lib/rspec/expectations/deprecation.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/deprecation.rb
rspec-expectations-2.4.0 lib/rspec/expectations/deprecation.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/deprecation.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/deprecation.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/deprecation.rb
rspec-expectations-2.3.0 lib/rspec/expectations/deprecation.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/deprecation.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/deprecation.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/deprecation.rb
rspec-expectations-2.2.0 lib/rspec/expectations/deprecation.rb
rspec-expectations-2.1.0 lib/rspec/expectations/deprecation.rb
rspec-expectations-2.0.1 lib/rspec/expectations/deprecation.rb