Sha256: 6608847412072d6208647bf5f9d2776d080907a21c54e3e7d8c268b55aeb962c
Contents?: true
Size: 524 Bytes
Versions: 12
Compression:
Stored size: 524 Bytes
Contents
module Riot # Asserts that the result of the test is a non-nil value. This is useful in the case where you don't want # to translate the result of the test into a boolean value # asserts("test") { "foo" }.exists # should("test") { 123 }.exists # asserts("test") { "" }.exists # asserts("test") { nil }.exists # This would fail class ExistsMacro < AssertionMacro register :exists def evaluate(actual) !actual.nil? ? pass("is not nil") : fail("expected a non-nil value") end end end
Version data entries
12 entries across 12 versions & 1 rubygems