123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::Invocations::PrintVersion Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: rspec-core/lib/rspec/core/invocations.rb

Instance Method Summary

Instance Method Details

#call(_options, _err, out)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/invocations.rb', line 53

def call(_options, _err, out)
  overall_version = RSpec::Core::Version::STRING
  unless overall_version =~ /[a-zA-Z]+/
    overall_version = overall_version.split('.').first(2).join('.')
  end

  out.puts "RSpec #{overall_version}"

  [:Core, :Expectations, :Mocks, :Rails, :Support].each do |const_name|
    lib_name = const_name.to_s.downcase
    begin
      require "rspec/#{lib_name}/version"
    rescue LoadError
      # Not worth mentioning libs that are not installed
      nil
    else
      out.puts "  - rspec-#{lib_name} #{RSpec.const_get(const_name)::Version::STRING}"
    end
  end

  0
end