Module: RSpec::Core::SharedExampleGroup::TopLevelDSL Private

Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/shared_example_group.rb

Overview

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

Shared examples top level DSL.

Class Method Summary collapse

Class Method Details

.definitionsObject

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.



108
109
110
111
112
113
114
115
116
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/shared_example_group.rb', line 108

def self.definitions
  proc do
    def shared_examples(name, *args, &block)
      RSpec.world.shared_example_group_registry.add(:main, name, *args, &block)
    end
    alias shared_context      shared_examples
    alias shared_examples_for shared_examples
  end
end

.expose_globally!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.

Adds the top level DSL methods to Module and the top level binding.



126
127
128
129
130
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/shared_example_group.rb', line 126

def self.expose_globally!
  return if exposed_globally?
  Core::DSL.change_global_dsl(&definitions)
  @exposed_globally = true
end

.exposed_globally?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.

Returns:

  • (Boolean)


119
120
121
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/shared_example_group.rb', line 119

def self.exposed_globally?
  @exposed_globally ||= false
end

.remove_globally!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.

Removes the top level DSL methods to Module and the top level binding.



135
136
137
138
139
140
141
142
143
144
145
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/shared_example_group.rb', line 135

def self.remove_globally!
  return unless exposed_globally?

  Core::DSL.change_global_dsl do
    undef shared_examples
    undef shared_context
    undef shared_examples_for
  end

  @exposed_globally = false
end