Sha256: af425e9be5c54ece4436be145bdd96f54d4357d3f62a886bf948b1bb4ef5fbd5

Contents?: true

Size: 862 Bytes

Versions: 5

Compression:

Stored size: 862 Bytes

Contents

# frozen_string_literal: true

require 'active_support/all'
require "rspec_in_context/version"
require "rspec_in_context/in_context"
require "rspec_in_context/context_management"

# Main wrapping module
module RspecInContext
  # @api private
  # Inclusion convenience of the gem in RSpec
  def self.included(base)
    base.include(RspecInContext::InContext)
  end
end

# RSpec
module RSpec
  # 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 block [Proc] code that will be injected later
  def self.define_context(name, namespace: nil, ns: nil, &block)
    namespace ||= ns
    RspecInContext::InContext.outside_define_context(name, namespace, &block)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec_in_context-1.0.1.2 lib/rspec_in_context.rb
rspec_in_context-1.0.1.1 lib/rspec_in_context.rb
rspec_in_context-1.0.1 lib/rspec_in_context.rb
rspec_in_context-1.0.0 lib/rspec_in_context.rb
rspec_in_context-0.4.0 lib/rspec_in_context.rb