class Mutest::Matcher::Namespace

Matcher for specific namespace

Public Instance Methods

call(env) click to toggle source

Enumerate subjects

@param [Env::Bootstrap] env

@return [Enumerable<Subject>]

# File lib/mutest/matcher/namespace.rb, line 12
def call(env)
  Chain.new(
    matched_scopes(env).map { |scope| Scope.new(scope.raw) }
  ).call(env)
end

Private Instance Methods

match?(scope) click to toggle source

Test scope if matches expression

@param [Scope] scope

@return [Boolean]

# File lib/mutest/matcher/namespace.rb, line 36
def match?(scope)
  expression.prefix?(scope.expression)
end
matched_scopes(env) click to toggle source

The matched scopes

@param [Env] env

@return [Enumerable<Scope>]

# File lib/mutest/matcher/namespace.rb, line 25
def matched_scopes(env)
  env
    .matchable_scopes
    .select(&method(:match?))
end