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

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/integration/rspec/state_guard/example_groups_constants.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.

Instance Method Summary collapse

Instance Method Details

#release(before) ⇒ 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.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/evilution/integration/rspec/state_guard/example_groups_constants.rb', line 14

def release(before)
  return unless before
  return unless defined?(::RSpec::ExampleGroups)

  ::RSpec::ExampleGroups.constants(false).each do |c|
    next if before.include?(c)

    begin
      ::RSpec::ExampleGroups.send(:remove_const, c)
    rescue NameError
      next
    end
  end
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.



8
9
10
11
12
# File 'lib/evilution/integration/rspec/state_guard/example_groups_constants.rb', line 8

def snapshot
  return nil unless defined?(::RSpec::ExampleGroups)

  Set.new(::RSpec::ExampleGroups.constants(false))
end