Guest User

Untitled

a guest
May 27th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Rspec 2 (beta 9) transactional support for Sequel
  2.  
  3. Probably isn't ideal yet, but it works for me right now:
  4.  
  5. # in spec_helper.rb
  6. class RSpec::Core::Example
  7. alias_method :original_run, :run
  8.  
  9. def run(*args, &block)
  10. ret_val = nil
  11.  
  12. Sequel::Model.db.transaction do
  13. ret_val = original_run(*args, &block)
  14. raise Sequel::Rollback
  15. end
  16.  
  17. return ret_val
  18. end
  19. end
Add Comment
Please, Sign In to add comment