lib/rspec/sleeping_king_studios/concerns/shared_example_group.rb
# Aliases a defined shared example group, allowing it to be accessed using
# a new name. The example group must be defined in the current context
# using `shared_examples`. The aliases must be defined before including the
# module into an example group, or they will not be available in the
# example group.
#
# @param [String] new_name The new name to alias the shared example group
#   as.
# @param [String] old_name The name under which the shared example group is
#   currently defined.
#
# @raise ArgumentError If the referenced shared example group does not
#   exist.
Aliases a defined shared example group, allowing it to be accessed using
a new name. The example group must be defined in the current context
using `shared_examples`. The aliases must be defined before including the
module into an example group, or they will not be available in the
example group.
Aliases a defined shared example group allowing it to be accessed using a new name . The example group must be defined in the current context using ` shared_examples ` . The aliases must be defined before including the module into an example group or they will not be available in the example group .
def alias_shared_examples new_name, old_name
      example_group = shared_example_groups[self][old_name]
      definition    = example_group_definition(example_group)
      raise ArgumentError.new(%{Could not find shared examples "#{old_name}"}) if definition.nil?
      self.shared_examples new_name, &definition
    end
def alias_shared_examples new_name , old_name example_group = shared_example_groups [ self ] [ old_name ] definition = example_group_definition ( example_group ) raise ArgumentError . new ( %{Could not find shared examples "#{old_name}"} ) if definition . nil? self . shared_examples new_name , & definition end
Aliases a defined shared example group, allowing it to be accessed using
a new name.
Aliases a defined shared example group allowing it to be accessed using a new name .
ArgumentError If the referenced shared example group does not exist.
ArgumentError If the referenced shared example group does not exist .
new_name
<not_specific>
old_name
<not_specific>
<not_specific>
old_name The name under which the shared example group is currently defined.
old_name The name under which the shared example group is currently defined .