Class: ConvenientService::Dependencies::Queries::Gems::RSpec Private

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/dependencies/queries/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.

Returns:

  • (RSpec::Core::Example, nil)


51
52
53
54
55
56
57
58
59
60
# File 'lib/convenient_service/dependencies/queries/gems/rspec.rb', line 51

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

Returns:

  • (Boolean)


24
25
26
# File 'lib/convenient_service/dependencies/queries/gems/rspec.rb', line 24

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

.versionConvenientService::Dependencies::Queries::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.



35
36
37
# File 'lib/convenient_service/dependencies/queries/gems/rspec.rb', line 35

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