def self.set_it_up(*args)
ensure_example_groups_are_configured
symbol_description = args.shift if args.first.is_a?(Symbol)
args << build_metadata_hash_from(args)
args.unshift(symbol_description) if symbol_description
@metadata = RSpec::Core::Metadata.new(superclass_metadata).process(*args)
world.configure_group(self)
[:before, :after, :around].each do |_when|
RSpec.configuration.hooks[_when][:each].each do |hook|
unless ancestors.any? {|a| a.hooks[_when][:each].include? hook }
hooks[_when][:each] << hook
end
end
next if _when == :around
RSpec.configuration.hooks[_when][:all].each do |hook|
unless ancestors.any? {|a| a.hooks[_when][:all].include? hook }
hooks[_when][:all] << hook if hook.options_apply?(self)
end
end
end
end