assert2 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/assert2.rb +7 -3
  2. metadata +2 -2
data/lib/assert2.rb CHANGED
@@ -164,17 +164,21 @@ module Assert_2_0
164
164
  #
165
165
  # that becomes:
166
166
  # foo = assemble()
167
+ #
167
168
  # assert_yin_yang proc{ foo.bar() } do
168
169
  # foo.activate()
169
170
  # end
170
171
  #
171
- def assert_yin_yang(prock, diagnostic = nil, &block)
172
+ def assert_yin_yang(*args, &block)
173
+ # prock, diagnostic = nil, &block)
174
+ procks, diagnostic = args.partition{|p| p.respond_to? :call }
175
+ block ||= procks.shift
172
176
  source = reflect_source(&block)
173
177
  fuss = [diagnostic, "fault before calling:", source].compact.join("\n")
174
- deny fuss, &prock
178
+ procks.each do |prock| deny(fuss, &prock); end
175
179
  block.call
176
180
  fuss = [diagnostic, "fault after calling:", source].compact.join("\n")
177
- assert fuss, &prock
181
+ procks.each do |prock| assert(fuss, &prock); end
178
182
  end
179
183
 
180
184
  # the prock assertion must pass on both sides of the called block
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: assert2
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.1
7
- date: 2008-04-18 00:00:00 -07:00
6
+ version: 0.3.2
7
+ date: 2008-05-24 00:00:00 -07:00
8
8
  summary: An assertion that reflects its block, with all intermediate values
9
9
  require_paths:
10
10
  - lib