Skip to content

Instantly share code, notes, and snippets.

@chendo
Last active December 18, 2015 00:38
Show Gist options
  • Save chendo/5697551 to your computer and use it in GitHub Desktop.
Save chendo/5697551 to your computer and use it in GitHub Desktop.
Running individual specs in RubyMotion: When this file is placed in spec/helpers/ in a RubyMotion project, it lets you only run individual specs (`"t" statements) within a spec file.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment