Sha256: eb16b19d68fff467dc566017e58451f08c660a4337ca8f938fb48bcf02fb1166

Contents?: true

Size: 535 Bytes

Versions: 11

Compression:

Stored size: 535 Bytes

Contents

module Riot
  # Asserts the result of the test is a non-truthy value. Read the following assertions in the way Borat
  # learned about humor:
  #   asserts("you are funny") { false }.not!
  #   should("be funny") { nil }.not!
  #
  # Thusly, Borat would say "You are funny ... not!" The above two assertions would pass because the values
  # are non-truthy.
  class NotMacro < AssertionMacro
    register :not!

    def evaluate(actual)
      actual ? fail("expected to exist ... not!") : pass("does exist ... not!")
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
riot-0.11.4 lib/riot/assertion_macros/not_borat.rb
riot-0.11.4.pre lib/riot/assertion_macros/not_borat.rb
riot-0.11.3 lib/riot/assertion_macros/not_borat.rb
riot-0.11.2 lib/riot/assertion_macros/not_borat.rb
riot-0.11.1 lib/riot/assertion_macros/not_borat.rb
riot-0.11.0 lib/riot/assertion_macros/not_borat.rb
riot-0.10.13 lib/riot/assertion_macros/not_borat.rb
riot-0.10.13.pre lib/riot/assertion_macros/not_borat.rb
riot-0.10.12 lib/riot/assertion_macros/not_borat.rb
riot-0.10.12.pre lib/riot/assertion_macros/not_borat.rb
riot-0.10.11 lib/riot/assertion_macros/not_borat.rb