Permalink
Browse files

add deprecation warning to any macro

  • Loading branch information...
1 parent 61236aa commit 9b1510cd48216fc26844fff246d19ca0cbc68812 @charlietanksley charlietanksley committed Aug 22, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/riot/assertion_macros/any.rb
@@ -8,16 +8,20 @@ module Riot
#
# denies("an empty array") { [] }.any
# denies("an empty hash") { {} }.any
+ #
+ # @deprecated Please use +asserts.empty+ or +denies.empty+ instead.
class AnyMacro < AssertionMacro
register :any
# (see Riot::AssertionMacro#evaluate)
def evaluate(actual)
+ warn "any is deprecated; please use asserts.empty or denies.empty instead"
any?(actual) ? pass("has items") : fail(expected_message(actual).to_have_items)
end
# (see Riot::AssertionMacro#devaluate)
def devaluate(actual)
+ warn "any is deprecated; please use asserts.empty or denies.empty instead"
any?(actual) ? fail(expected_message(actual).not_to_have_items) : pass("has items")
end
private

0 comments on commit 9b1510c

Please sign in to comment.