On Dec 8, 9:21 am, Steve Tooke <[email protected]> wrote:
> Is anybody using Cucumber to test an app built with Sequel?
>
> I'm trying to ensure that each scenario is run within a transaction.
>
> A cucumber 'World' defines Before and After hooks, but as far as I can
> tell, sequel only allows you to create transactions using a block
> syntax so I'm struggling with the best way to approach it.
>
> Has anybody solved this problem already?

I use transactional unit tests in most of my apps, using RSpec:

class Spec::Example::ExampleGroup
  def execute(*args, &block)
    DB.transaction{super(*args, &block); raise
Sequel::Error::Rollback}
  end
end

I haven't used Cucumber, so I'm not sure how to do it there, but
something similar to that should work.

The lack of a non-block form for transactions is by design, FWIW.

Jeremy

--

You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.


Reply via email to