Sha256: 001564a71a6831fffd48cc4c1c74e5ae347e3d30224bc81c7b8e09c72b311416

Contents?: true

Size: 1.26 KB

Versions: 29

Compression:

Stored size: 1.26 KB

Contents

module RSpec
  module Core
    module Formatters
      class DeprecationFormatter
        def initialize(deprecation_stream=$stderr, summary_stream=$stdout)
          @deprecation_stream = deprecation_stream
          @summary_stream = summary_stream
          @count = 0
        end

        def start(example_count=nil)
          #no-op to fix #966
        end

        def deprecation(data)
          @count += 1
          if data[:message]
            @deprecation_stream.print data[:message]
          else
            @deprecation_stream.print "DEPRECATION: " unless File === @deprecation_stream
            @deprecation_stream.print "#{data[:deprecated]} is deprecated."
            @deprecation_stream.print " Use #{data[:replacement]} instead." if data[:replacement]
            @deprecation_stream.print " Called from #{data[:call_site]}." if data[:call_site]
            @deprecation_stream.puts
          end
        end

        def deprecation_summary
          if @count > 0 && File === @deprecation_stream
            @summary_stream.print "\n#{@count} deprecation"
            @summary_stream.print "s" if @count > 1
            @summary_stream.print " logged to "
            @summary_stream.puts @deprecation_stream.path
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-core-2.14.8/lib/rspec/core/formatters/deprecation_formatter.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
rspec-core-2.14.8 lib/rspec/core/formatters/deprecation_formatter.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
dxruby_rp5-0.0.3 spec/vendor/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
tuktuk-rails-0.0.10 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
tuktuk-rails-0.0.9 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
tuktuk-rails-0.0.8 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
tuktuk-rails-0.0.7 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
dxruby_rp5-0.0.2 spec/vendor/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
dxruby_rp5-0.0.1 spec/vendor/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb