Last active
December 18, 2015 00:38
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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