:if and :unless filters are ignored when a description filter is applied
Created by: myronmarston
This is a followup to #1474.
Given this spec file:
RSpec.describe "Foo" do
context "when bar" do
it "does one thing on 1.8", :if => RUBY_VERSION < '1.9' do
expect(RUBY_VERSION).to be < '1.9'
end
it 'does something else on 1.9+', :unless => RUBY_VERSION < '1.9' do
expect(RUBY_VERSION).to be >= '1.9'
end
end
end
I would expect bin/rspec -e "when bar"
to run only one of the examples -- the first one if running ruby 1.8, and the 2nd otherwise. This worked in 2.x but is now broken in master. I git bisected it and found the culprit is ffd904cf from PR #1195 by @JonRowe.