Thanks for explaining - enormously helpful. Here's my solution:
RSpec.configure do |config|
config.register_ordering(:global) do |items|
items.sort_by do |group|
case group.metadata[:type]
when :feature then 50
when :request then 40
when :model then 10
else 20
end
end
end
end
On Friday, February 27, 2015 at 7:53:48 PM UTC-8, Myron Marston wrote:
>
> On Friday, February 27, 2015 at 11:49:26 AM UTC-8, AndyL wrote:
>>
>> Thanks for your reply Myron -
>>
>> I'd like to boot rspec just once. I tried using the global ordering
>> technique, but it looks to me like it is called once per spec file,
>> populating the 'list' argument with the list of example groups in that file.
>>
>> I'm interested in reordering the list of files to be run, not the example
>> groups within a file. Is there a way to reorder files?
>>
>
> It's called one time per level of nesting -- one time with all top level
> groups, and then one time per group (at any level) with its nested examples
> and groups. It doesn't split things by file at all, unless you organize
> things so that you have one example group per file.
>
> And to clarify a bit: to RSpec, files only have meaning in that they are
> what it loads. Once it's loaded the spec files it deals only in the
> in-memory example groups and examples, and reording files isn't even a
> concept that would make sense.
>
> Myron
>
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/e2b15fe7-160e-4af5-89f3-3b3c875748bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.