code and tests for directive run selectors