Class: Evilution::Integration::RSpec::StateGuard Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/integration/rspec/state_guard/internals.rb,
lib/evilution/integration/rspec/state_guard.rb,
lib/evilution/integration/rspec/state_guard/example_groups_constants.rb,
lib/evilution/integration/rspec/state_guard/object_space_example_groups.rb

Overview

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.

rubocop:disable Lint/EmptyClass

Defined Under Namespace

Modules: Internals Classes: ConfigurationState, ConfigurationStreams, ExampleGroupsConstants, ObjectSpaceExampleGroups, ReporterArrays, WorldExampleGroups, WorldFilteredExamples, WorldSourcesByPath

Constant Summary collapse

DEFAULT_STRATEGIES =

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

[
  ObjectSpaceExampleGroups.new,
  WorldExampleGroups.new,
  WorldSourcesByPath.new,
  WorldFilteredExamples.new,
  ReporterArrays.new,
  ExampleGroupsConstants.new,
  ConfigurationState.new
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(strategies: DEFAULT_STRATEGIES) ⇒ StateGuard

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 a new instance of StateGuard.



23
24
25
# File 'lib/evilution/integration/rspec/state_guard.rb', line 23

def initialize(strategies: DEFAULT_STRATEGIES)
  @strategies = strategies
end

Instance Method Details

#release(token) ⇒ Object

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.



31
32
33
# File 'lib/evilution/integration/rspec/state_guard.rb', line 31

def release(token)
  token.reverse_each { |strategy, captured| release_one(strategy, captured) }
end

#snapshotObject

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.



27
28
29
# File 'lib/evilution/integration/rspec/state_guard.rb', line 27

def snapshot
  @strategies.map { |s| [s, s.snapshot] }
end