Module: RSpec::Given

Defined in:
lib/rspec/given.rb,
lib/rspec/given/failure.rb,
lib/rspec/given/version.rb,
lib/rspec/given/extensions.rb,
lib/rspec/given/file_cache.rb,
lib/rspec/given/have_failed.rb,
lib/rspec/given/line_extractor.rb,
lib/rspec/given/module_methods.rb

Defined Under Namespace

Modules: ClassExtensions, HaveFailed, InstanceExtensions Classes: Failure, FileCache, LineExtractor

Constant Summary collapse

VERSION_NUMBERS =
[
  VERSION_MAJOR = 2,
  VERSION_MINOR = 2,
  VERSION_BUILD = 1,
]
VERSION =
VERSION_NUMBERS.join(".")

Class Method Summary collapse

Class Method Details

.detect_formatters(c) ⇒ Object



11
12
13
14
# File 'lib/rspec/given/module_methods.rb', line 11

def self.detect_formatters(c)
  format_active = c.formatters.any? { |f| f.class.name !~ /ProgressFormatter/ }
  RSpec::Given.source_caching_disabled = ! format_active
end

.source_caching_disabledObject



3
4
5
# File 'lib/rspec/given/module_methods.rb', line 3

def self.source_caching_disabled
  @_rg_source_caching_disabled
end

.source_caching_disabled=(value) ⇒ Object



7
8
9
# File 'lib/rspec/given/module_methods.rb', line 7

def self.source_caching_disabled=(value)
  @_rg_source_caching_disabled = value
end

.using_old_rspec?Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
# File 'lib/rspec/given.rb', line 3

def self.using_old_rspec?
  defined?(Spec) &&
    defined?(Spec::VERSION) &&
    defined?(Spec::VERSION::SUMMARY) &&
    Spec::VERSION::SUMMARY =~ /^rspec +1\./
end