Class: RSpec::Core::Formatters::DeprecationFormatter

### Home Classes Methods

### In Files

- lib/rspec/core/formatters/deprecation_formatter.rb

### Parent

Object

### Methods

- ::new
- #deprecation
- #deprecation_summary
- #start

### Class/Module Index

Quicksearch

- RSpec
- RSpec::Core
- RSpec::Core::BacktraceCleaner
- RSpec::Core::BacktraceFormatter
- RSpec::Core::CommandLine
- RSpec::Core::Configuration
- RSpec::Core::Configuration::MustBeConfiguredBeforeExampleGroupsError
- RSpec::Core::ConfigurationOptions
- RSpec::Core::ConstMissing
- RSpec::Core::DRbCommandLine
- RSpec::Core::DSL
- RSpec::Core::Deprecation
- RSpec::Core::DrbOptions
- RSpec::Core::Example
- RSpec::Core::Example::NotPendingExampleFixed
- RSpec::Core::Example::Procsy
- RSpec::Core::ExampleGroup
- RSpec::Core::Extensions
- RSpec::Core::Extensions::InstanceEvalWithArgs
- RSpec::Core::Extensions::ModuleEvalWithArgs
- RSpec::Core::Extensions::Ordered
- RSpec::Core::Extensions::Ordered::ExampleGroups
- RSpec::Core::Extensions::Ordered::Examples
- RSpec::Core::FilterManager
- RSpec::Core::FilterManager::BackwardCompatibility
- RSpec::Core::FilterManager::Describable
- RSpec::Core::Formatters
- RSpec::Core::Formatters::BaseFormatter
- RSpec::Core::Formatters::BaseTextFormatter
- RSpec::Core::Formatters::DeprecationFormatter
- RSpec::Core::Formatters::DocumentationFormatter
- RSpec::Core::Formatters::Helpers
- RSpec::Core::Formatters::HtmlFormatter
- RSpec::Core::Formatters::HtmlPrinter
- RSpec::Core::Formatters::JsonFormatter
- RSpec::Core::Formatters::ProgressFormatter
- RSpec::Core::Formatters::SnippetExtractor
- RSpec::Core::Formatters::SnippetExtractor::NullConverter
- RSpec::Core::Formatters::TextMateFormatter
- RSpec::Core::Hooks
- RSpec::Core::Hooks::AfterAllHook
- RSpec::Core::Hooks::AfterHook
- RSpec::Core::Hooks::AroundHook
- RSpec::Core::Hooks::AroundHookCollection
- RSpec::Core::Hooks::BeforeHook
- RSpec::Core::Hooks::GroupHookCollection
- RSpec::Core::Hooks::Hook
- RSpec::Core::Hooks::HookCollection
- RSpec::Core::Hooks::HookCollectionAliases
- RSpec::Core::Hooks::RegistersGlobals
- RSpec::Core::MemoizedHelpers
- RSpec::Core::MemoizedHelpers::BeforeAllMemoizedHash
- RSpec::Core::MemoizedHelpers::ClassMethods
- RSpec::Core::Metadata
- RSpec::Core::Metadata::ExampleMetadataHash
- RSpec::Core::Metadata::GroupMetadataHash
- RSpec::Core::Metadata::MetadataHash
- RSpec::Core::MetadataHashBuilder
- RSpec::Core::MetadataHashBuilder::Common
- RSpec::Core::MetadataHashBuilder::WithConfigWarning
- RSpec::Core::MetadataHashBuilder::WithDeprecationWarning
- RSpec::Core::MockFrameworkAdapter
- RSpec::Core::Parser
- RSpec::Core::Pending
- RSpec::Core::Pending::PendingDeclaredInExample
- RSpec::Core::Pending::PendingExampleFixedError
- RSpec::Core::ProjectInitializer
- RSpec::Core::RakeTask
- RSpec::Core::Reporter
- RSpec::Core::RubyProject
- RSpec::Core::Runner
- RSpec::Core::SharedContext
- RSpec::Core::SharedExampleGroup
- RSpec::Core::SharedExampleGroup::Collection
- RSpec::Core::SharedExampleGroup::Registry
- RSpec::Core::SharedExampleGroup::TopLevelDSL
- RSpec::Core::Time
- RSpec::Core::Version
- RSpec::Core::World
- RSpec::Rake
- RSpec::Runner
- Autotest
- Autotest::Rspec2
- Kernel

No matching classes.

# RSpec::Core::Formatters::DeprecationFormatter

### Public Class Methods

new(deprecation_stream=$stderr, summary_stream=$stdout) click to toggle source

    # File lib/rspec/core/formatters/deprecation_formatter.rb, line 5
    def initialize(deprecation_stream=$stderr, summary_stream=$stdout)
      @deprecation_stream = deprecation_stream
      @summary_stream = summary_stream
      @count = 0
    end

### Public Instance Methods

deprecation(data) click to toggle source

    # File lib/rspec/core/formatters/deprecation_formatter.rb, line 15
    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

deprecation_summary() click to toggle source

    # File lib/rspec/core/formatters/deprecation_formatter.rb, line 28
    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

start(example_count=nil) click to toggle source

    # File lib/rspec/core/formatters/deprecation_formatter.rb, line 11
    def start(example_count=nil)
      #no-op to fix #966
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.