On Jun 4, 1:22 pm, Jeremy Evans <[email protected]> wrote:
> On Jun 4, 12:48 pm, GregD <[email protected]> wrote:
>
> > Ruby novice -> I don't see the execute method defined for
> > Spec::Example::ExampleGroup.
>
> > So, what is super calling?
>
> > I tried putting puts into the code to see if it was being executed.  I
> > did not see the output.  So, I'm thinking execute method is not ever
> > be called.  Or rspec is filtering STDOUT.
>
> More likely it's not being called.  What version of rspec are you
> using?  It might be a later version than I'm using, and they could
> have changed the API. It used to be defined in
> Spec::Example::ExampleMethods, which was included in
> Spec::Example::ExampleGroup, so super in Spec::Example::ExampleGroup
> would call the version in Spec::Example::ExampleMethods.

Still appears to be there: 
http://github.com/dchelimsky/rspec/blob/master/lib/spec/example/example_methods.rb#L32

Are you sure your code is being executed at all.  Try this instead:

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

If you only see the first puts but not the second, I'm not sure what
is going on.  If you don't see either, then your code isn't being
loaded.

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