redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

Consider allowing an "around" test callback #157

Closed jcredding closed 10 years ago

jcredding commented 10 years ago

This would work like Rails' around callbacks. I believe they rely on the callback yielding, which triggers. This would work something like:

class DbTests < Assert::Context
  around_test do
    ActiveRecord::Base.transaction do
      yield
      raise ActiveRecord::Rollback
    end
  end
end

As the example shows, this could be useful with ActiveRecord transactions.