Sha256: 5206c2273e8759c04eb8197024675995e2eb0b5ab08ef95249711ff963cad1c3

Contents?: true

Size: 773 Bytes

Versions: 186

Compression:

Stored size: 773 Bytes

Contents

require 'mspec/runner/mspec'

# Holds some of the state of the example (i.e. +it+ block) that is
# being evaluated. See also +ContextState+.
class ExampleState
  attr_reader   :context, :it, :example

  def initialize(context, it, example=nil)
    @context  = context
    @it       = it
    @example  = example
  end

  def context=(context)
    @description = nil
    @context = context
  end

  def describe
    @context.description
  end

  def description
    @description ||= "#{describe} #{@it}"
  end

  def filtered?
    incl = MSpec.retrieve(:include) || []
    excl = MSpec.retrieve(:exclude) || []
    included   = incl.empty? || incl.any? { |f| f === description }
    included &&= excl.empty? || !excl.any? { |f| f === description }
    not included
  end
end

Version data entries

186 entries across 162 versions & 4 rubygems

Version Path
rhodes-2.0.0.rc2 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.rc2 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.rc1 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.rc1 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta11 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta11 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta10 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta10 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta9 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta9 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta8 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta8 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta7 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta7 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta6 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta6 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta4 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta4 spec/framework_spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta3 res/generators/templates/spec/app/mspec/runner/example.rb
rhodes-2.0.0.beta3 spec/framework_spec/app/mspec/runner/example.rb