test/test_helper.rb in bindata-2.2.0 vs test/test_helper.rb in bindata-2.3.0

- old
+ new

@@ -45,6 +45,17 @@ err_line = line_num_regex.match(ex.backtrace[0])[1].to_i ref_line = line_num_regex.match(ex.backtrace[idx + 1])[1].to_i (err_line - ref_line).must_equal line end + + def must_warn(msg, &block) + result = "" + callable = proc { |str| + result = str + } + self.stub(:warn, callable) do + block.call + end + result.must_equal msg + end end