voxpupuli / json-schema

Ruby JSON Schema Validator
MIT License
1.52k stars 242 forks source link

Stopped the additional properties test from using class_eval #332

Closed iainbeeston closed 7 years ago

iainbeeston commented 8 years ago

class_eval is dangerous to use, as it injects a string into a class as ruby code, meaning that it's very easy to make mistakes. In this case there is no need to use it, and I have re-written this test to use multiple assertions per test instead (also not ideal, but better).

I've also made this test use the same assertion helpers as every other test (previously it was defining it's own assertion helpers).

iainbeeston commented 7 years ago

Hey @RST-J am I ok to merge this? It seems innocuous but it will make refactoring other tests easier

RST-J commented 7 years ago

Yeah, go! :smile: :+1:

iainbeeston commented 7 years ago

Done, thanks!