qed/03_assert.rdoc in ae-1.4.0 vs qed/03_assert.rdoc in ae-1.5.0

- old
+ new

@@ -9,11 +9,11 @@ to true. Optionally one can send along a meaningful message should the assertion fail. assert(true, "Not true!") - Assertion.assert.raised? do + expect Assertion do assert(false, "Not true!") end == Assert with a Block @@ -269,22 +269,24 @@ def initialize(a); @a = a; end end x = X.new(4) - x.assert.instance_eval do - 4 == @a + x.instance_eval do + @a.assert == 4 end -And should it fail +However #instance_eval is a reserved method for the underlying Assertor class, +so it cannot be used on #assert, e.g. - Assertion.assert.raised? do - x.assert.instance_eval do - 5 == @a - end + x.assert.instance_eval do + @a == "obvisouly wrong" end +AE offers an optional helper method for times when testing underlying private +or protected methods is important, called #pry. See the QED on pry for more +information. + For some testing underlying implementation might be considered poor form. You will get no argument here. It should be used thoughtfully, but I would not bet against there being occasions when such validations -might be handy. - +might be needed.