I want to access the tag filters passed on the command line
Command line
rspec --tag use_ff
RSpec configuration
RSpec.configure do |config| config.before :suite, type: :feature do # how do I check if use_ff filter was specified in the command line? if filter[:use_ff] use_selenium else use_poltergeist end end end
In hook before(:suite) I want to access the tag filters specified on the command line in config.
According to the rspec-core code base, inclusion tag filters are stored in include_filter RSpec.configuration. Theoretically, I should have access to them as follows:
RSpec.configure do |config| config.before :suite, type: :feature do if config.filter[:use_ff]
But for some reason, I get an empty hash even when passing the tag from the command line.
source share