Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/testrocket.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

require 'colorize'
##
# TestRocket Module to refine lambdas an use them for lightweight tests
#
Expand All @@ -23,15 +23,15 @@ def _desc; end
else
def _test(a, b); send((call rescue()) ? a : b) end
def _show(r); (TestRocket.out || STDERR) << r + "\n"; r end
def _pass; ' OK' end
def _fail; " FAIL @ #{source_location * ':'}" end
def _pend; "PENDING '#{call}' @ #{source_location * ':'}" end
def _desc; " FIRE '#{call}'!" end
def _pass; ' OK'.green end
def _fail; " FAIL @ #{source_location * ':'}".red end
def _pend; "PENDING '#{call}' @ #{source_location * ':'}".cyan end
def _desc; " FIRE '#{call}'!".blue end
end

def +@; _show _test :_pass, :_fail end
def -@; _show _test :_fail, :_pass end
def ~; _show _pend end
def !; _show _desc end
end
end
end