Add test cases for #setRules. Closes #11