add CLI validation for knife cook #73

Merged
merged 2 commits into from Jun 27, 2012

2 participants

@deepak
  • add tests for CLI validation on knife prepare and cook
  • show help in case CLI validation fails
@deepak deepak add CLI validation for knife cook
- add tests for CLI validation on knife prepare and cook
- show help in case CLI validation fails
1e4542c
@matschaffer matschaffer and 1 other commented on an outdated diff Jun 27, 2012
lib/chef/knife/cook.rb
@@ -20,6 +20,10 @@ class Cook < Knife
include KnifeSolo::KitchenCommand
include KnifeSolo::Tools
+ class WrongCookError < KnifeSolo::KnifeSoloError
+ alias :message :to_s
@matschaffer
Owner
matschaffer added a line comment Jun 27, 2012

Why the alias here?

@deepak
deepak added a line comment Jun 27, 2012

my bad. previously it was a subclass of OutOfKitchenError.
OutOfKitchenError#message is defined with a default message.
and in the subclass, the specific error message was being ignored

self contained example here, https://gist.github.com/3004559

not needed now, will push a fix

@matschaffer
Owner
matschaffer added a line comment Jun 27, 2012
@deepak
deepak added a line comment Jun 27, 2012

pushed a fix, deepak@c2da04c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@matschaffer matschaffer merged commit 212af84 into matschaffer:master Jun 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment