Re:A routine gem update ended up creating $73k worth of subs...
by kinduff on Friday January 07, 2022 @07:55PM
(#29847314)
Learned this the hard way. No matter the change or version, I always try to double check both CHANGELOG and the commits.
[ Parent
| on HN ]
Re:A routine gem update ended up creating $73k worth of subs...
by montblanc on Friday January 07, 2022 @09:54PM
(#29848142)
I think tests should have caught that one but I agree.
Re:A routine gem update ended up creating $73k worth of subs...
by henry700 on Friday January 07, 2022 @10:04PM
(#29848202)
Not if you follow the One True Way of Unit Testing (tm) where the Mongoid lib would have been mocked away, and the test would pass :)
Integration tests might've done the job here.
Re:A routine gem update ended up creating $73k worth of subs...
by montblanc on Saturday January 08, 2022 @03:27AM
(#29849787)
You dont mock the db layer, i dont do that at least, hell no. Let the db be hit, check that the records it returns make sense. Thats how I roll at least.
Re:A routine gem update ended up creating $73k worth of subs...
by henry700 on Sunday January 09, 2022 @11:08PM
(#29870521)
Didn't want to aim at you with the reply, just remembered the collective delusion of 100% coverage unit testing zealots and how this would ironically fail to catch this.
You'd be surprised how far people go to shoot themselves in the foot.