We have a shared context that is included automatically by the presence of
particular metadata.
I'm wondering if it's possible for the shared context to append or
otherwise mutate the example's description with additional text. (Basically
we want presence of the included context to be explicit in the example
description itself, as well as to include pieces of the metadata itself.)
RSpec.describe Something, auth: :customer do
it "does thing"
end
shared_context "authenticated" do
let(:current_user) { logs_in_as self.class.metadata[:auth] }
# hoping for a before or around hook that can insert contextual
description at this scope of the example
end
config.include_context "authenticated", :auth
Desired result: "Something authenticated as a customer does thing"
Have others done something similar or have alternatives?
Thanks,
Jason Karns
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/22e833a2-8cca-45de-8a03-4bd2984eb5ean%40googlegroups.com.