lib/dfect.rb in dfect-1.0.0 vs lib/dfect.rb in dfect-1.1.0
- old
+ new
@@ -1,8 +1,8 @@
#--
-# Copyright 2009 Suraj N. Kurapati
-# See the LICENSE file for details.
+# Copyright protects this work.
+# See LICENSE file for details.
#++
require 'yaml'
#
# YAML raises this error when we try to serialize a class:
@@ -523,10 +523,31 @@
def C? message = nil, symbol = nil, &block
assert_catch :sample, message, symbol, &block
end
##
+ # Adds the given message to the report inside
+ # the section of the currently running test.
+ #
+ # You can think of "S" as "say" or "status".
+ #
+ # ==== Parameters
+ #
+ # [message]
+ # Objects to be added to the report.
+ #
+ # ==== Examples
+ #
+ # S "establishing connection..."
+ #
+ # S "beginning calculation...", Math::PI, [1, 2, 3, ['a', 'b', 'c']]
+ #
+ def S *message
+ @exec_trace.concat message
+ end
+
+ ##
# Executes all tests defined thus far and stores the results in #report.
#
# ==== Parameters
#
# [continue]
@@ -912,12 +933,12 @@
##
# Allows before and after hooks to be specified via
# the D() method syntax when this module is mixed-in:
#
+ # D .<< { puts "before all nested tests" }
# D .< { puts "before each nested test" }
# D .> { puts "after each nested test" }
- # D .<< { puts "before all nested tests" }
# D .>> { puts "after all nested tests" }
#
D = self
# provide mixin-able assertion methods