Regexes for the Serverspec 2 Update
| Comments
The Serverspec team just released v2 of their outstanding testing library today, after a very long beta period. The v2 release had a few breaking breaking changes due to dropped rspec matchers that had been deprecated.
If your test-kitchen tests recently broke today, here’s a few regexes I used with Sublime Text’s regex find/replace to rewrite the dropped matchers for the new matchers.
1 2 3 4 5 6 7 8 9 10 11
it\s*\{\s*(should|should_not)\s*return_(stdout|stderr)\s*\(?(\/.*\/)\)?\s*\}
its(:2円) { 1円 match 3円 }
it\s*\{\s*(should|should_not)\s*return_(stdout|stderr)\s*\(?(\".*\")\)?\s*\}
its(:2円) { 1円 contain 3円 }
it\s*\{\s*(should|should_not)\s*return_(stdout|stderr)\s*\(?('.*')\)?\s*\}
its(:2円) { 1円 contain 3円 }
it\s*\{\s*(should|should_not)\s*return_exit_status\s*(\d+)\s*\}
its(:exit_status) { 1円 eq 2円 }
Hopefully the kitchen busser project will one day add support for Gemfile-style constraints on the test node, since busser always installs the latest version of a busser plugin gem today..