collectiveidea / json_spec

Easily handle JSON in RSpec and Cucumber
rubygems.org/gems/json_spec
MIT License
919 stars 114 forks source link

Update exclusion #58

Closed charlierudolph closed 9 years ago

charlierudolph commented 10 years ago

Because excluded keys are simply removed from all hashes, be_json_eql is not testing for their presence. Keys are excluded because we can't guarantee the value will match (id, created_at, updated_at). By removing them we avoid the conflicting values but we lose the check for presence. I solved this by instead setting the value of excluded keys to 1. This way we no longer care about conflicting values and retain the presence check.

laserlemon commented 10 years ago

@charlierudolph Would love to chat with you about this. Shoot me an email at steve.richert at gmail? Thanks!

charlierudolph commented 10 years ago

@laserlemon thoughts?