Class: ConvenientService::Support::Gems::RSpec Private

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/support/gems/rspec.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.current_exampleRSpec::Core::Example?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
47
48
49
50
51
52
53
# File 'lib/convenient_service/support/gems/rspec.rb', line 44

def current_example
  return unless loaded?

  ##
  # NOTE: This happens in Ruby-only projects where RSpec is loaded by `Bundler.require`, not by `bundle exec rspec`.
  #
  return unless ::RSpec.respond_to?(:current_example)

  ::RSpec.current_example
end

.loaded?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

rubocop:disable Style/TernaryParentheses



18
19
20
# File 'lib/convenient_service/support/gems/rspec.rb', line 18

def loaded?
  (defined? ::RSpec) ? true : false
end

.versionConvenientService::Support::Version

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/convenient_service/support/gems/rspec.rb', line 29

def version
  loaded? ? Support::Version.new(::RSpec::Core::Version::STRING) : Support::Version.null_version
end