If any part of the metadata matches an exclusion it will not be run:
RSpec.configure do |config|
config.filter_run_excluding :meta_a, meta_b: true, meta_c: :value
config.filter_run_including meta_a: trueend
RSpec.describe "working with metadata" do
it "excludes fully matching metadata (:meta, meta_b: true, meta_c: :value)",
:meta_a, meta_b: true, meta_c: :value do
raise "This should not run!"
end
it "excludes partially matching metadata (:meta)", meta_a: true do
raise "This should not run!"
end
it "excludes partially matching metadata (meta_b: true)", :meta_b do
raise "This should not run!"
end
it "excludes partially matching metadata (meta_c: :value)", meta_c: :value do
raise "This should not run!"
end
it "excludes partially matching metadata (:other, :meta_a)",
:other, :meta_a do
expect(:run).to be :run
end
it "runs fully non-matching metadata values (meta_a: false)", meta_a: false do
expect(:run).to be :run
end
it "runs fully non-matching metadata values (meta_c: :other)",
meta_c: :other do
expect(:run).to be :run
end
it "runs other metadata", other: true do
expect(:run).to be :run
end
end
# =># Run options:# include {:focus=>true}# exclude
{:meta_b=>true, :meta_c=>:value, :meta_a=>true,
:ruby=>#<Proc:./spec/spec_helper.rb:106>}## All examples were filtered
out; ignoring {:focus=>true}## Randomized with seed 56839## working
with metadata# runs other metadata# runs fully non-matching
metadata values (meta_c: :other)# runs fully non-matching metadata
values (meta_a: false)## Finished in 0.0037 seconds (files took
0.26485 seconds to load)# 3 examples, 0 failures
On Fri, Jul 31, 2015 at 2:33 PM, SJ <[email protected]> wrote:
> I am trying to figure out how does the metadata tags works if I have same
> metadata is included in both inclusion and exclusion criterion.
>
>
> Rspec.configure do |config|
>
> config.filter_run_excluding { platform_1: true, platform_2: true }
> config.filter_run_including { platform_1: true }
> end
>
>
> it 'should do something', platform_1: true do
> # spec to be implemented
> end
>
> Thanks,
> - SJ
>
>
>
> --
> 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/6a3b0b0b-6adb-4e09-b91a-2eba408fcaea%40googlegroups.com
> <https://groups.google.com/d/msgid/rspec/6a3b0b0b-6adb-4e09-b91a-2eba408fcaea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAKCESdhUmHiM7%2BY0VQETOCpGkeRDTeRp0kkV_B7XigAGbbaRYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.