module RSpec

RSpec

Public Class Methods

define_context(name, namespace: nil, ns: nil, silent: true, print_context: nil, &block) click to toggle source

Allows you to define contexts outside of RSpec.describe blocks

@param name [String, Symbol] Name of the defined context @param namespace [String, Symbol] Namespace where to store your context @param ns Alias of namespace @param silent [Boolean] Does the in_context should wrap itself into a context block with its name @param print_context [Boolean] Reverse alias of silent @param block [Proc] code that will be injected later

# File lib/rspec_in_context.rb, line 27
def self.define_context(name, namespace: nil, ns: nil, silent: true, print_context: nil, &block)
  namespace ||= ns
  silent = print_context.nil? ? silent : !print_context
  RspecInContext::InContext.outside_define_context(name, namespace, silent, &block)
end