Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Rspec 2 (beta 9) transactional support for Sequel
- Probably isn't ideal yet, but it works for me right now:
- # in spec_helper.rb
- class RSpec::Core::Example
- alias_method :original_run, :run
- def run(*args, &block)
- ret_val = nil
- Sequel::Model.db.transaction do
- ret_val = original_run(*args, &block)
- raise Sequel::Rollback
- end
- return ret_val
- end
- end
Add Comment
Please, Sign In to add comment