-
-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pending Shared Example #1583
Comments
Arguments passed to It would be confusing to treat the arguments as metadata as well. You can get the behavior you want, though: shared_examples_for "a duck type" do |*metadata|
context "describe this group", *metadata do
# put the specs in here.
end
end |
Alternately, if you don't want to wrap the specs in an additional context, you can support shared_examples_for "a duck type" do |*flags|
before { pending } if flags.include?(:pending)
# specs go here
end |
Yes thanks very much - that will work perfectly. |
If anyone else finds this issue via Google, here's another trick you can use at the call site, which doesn't require modifying the shared examples definition to take a metadata or flags argument: it_behaves_like 'some shared example' do
before { pending }
end |
I believe the issue should be reopened and one of the following should be done
|
Happy to accept a PR to improve the documentation if you'd like to attempt it, but I don't feel the api should be expanded to change this behaviour. |
I've got a collection of duck-type classes that all implement a set of methods.
I'm able to build a shared example group that describes a these methods.
In my situation, I have implemented
Class1#method1
, butClass2#method1
is pending.I'd like the ability to say:
I can apply
pending
to a shared example, but not toit_should_behave_like
. This is sub-optimal when working with a collection of duck-types where some class implementations are complete and others are pending.Enhancement requests:
:pending
attribute forit_should_behave_like
:skip
attribute forit_should_behave_like
xit_should_behave_like
The text was updated successfully, but these errors were encountered: