moved ruleCondition to own file and wrote tests for it