Permalink
Browse files

add config option to suppress_deprecation_warnings

  • Loading branch information...
1 parent a65cc5f commit 68a49d2a8542abdaf2fe1e1eb4a5ead011194d93 @dchelimsky committed Oct 3, 2010
Showing with 11 additions and 2 deletions.
  1. +2 −1 lib/spec/deprecation.rb
  2. +8 −0 lib/spec/runner/configuration.rb
  3. +1 −1 spec/spec_helper.rb
View
@@ -1,7 +1,8 @@
module Spec
class << self
def deprecate(method, alternate_method=nil)
- message = <<-NOTICE
+ return if Spec::Runner.configuration.suppress_deprecation_warnings?
+ message = <<-NOTICE
*****************************************************************
DEPRECATION WARNING: you are using deprecated behaviour that will
@@ -154,6 +154,14 @@ def ignore_backtrace_patterns(*patterns)
def ignored_backtrace_patterns # :nodoc:
@ignored_backtrace_patterns ||= []
end
+
+ def suppress_deprecation_warnings!
+ @suppress_deprecation_warnings = true
+ end
+
+ def suppress_deprecation_warnings?
+ @suppress_deprecation_warnings ||= false
+ end
private
View
@@ -109,4 +109,4 @@ def initialize(proxy=nil, &block)
Spec::Runner.configure do |config|
config.extend(Macros)
-end
+end

0 comments on commit 68a49d2

Please sign in to comment.