Sha256: 5e2e09febadc9872ecbbc9df1e95fcf06a4d255e58295f94a8b65b635f9ee1b6

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

# Add following abilities
#
#   rake spec filter="name of spec"                   # To filter by spec name
#   rake spec files=foo_spec filter="name of spec"
#   rake spec filter_context="this doesn't work yet"  # To filter by context name (doesn't work until MacBacon implements it)
#   rake spec hide_backtraces=yes                     # Hide backtraces
#   rake spec focus=block/03_paragraph                # Focus on only certain testcase files


# From http://chen.do/blog/2013/06/03/running-individual-specs-with-rubymotion/
#------------------------------------------------------------------------------
def silence_warnings(&block)
  warn_level = $VERBOSE
  $VERBOSE = nil
  begin
    result = block.call
  ensure
    $VERBOSE = warn_level
  end
  result
end

silence_warnings do
  module Bacon
    if ENV['filter']
      $stderr.puts "Filtering specs that match: #{ENV['filter']}"
      RestrictName = Regexp.new(ENV['filter'])
    end

    if ENV['filter_context']
      $stderr.puts "Filtering contexts that match: #{ENV['filter_context']}"
      RestrictContext = Regexp.new(ENV['filter_context'])
    end

    Backtraces = false if ENV['hide_backtraces']
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
motion-kramdown-0.6.0 spec/helpers/spec_options.rb
motion-kramdown-0.5.1 spec/helpers/spec_options.rb
motion-kramdown-0.5.0 spec/helpers/spec_options.rb