Class: CodeDrivenDevelopment::Rule::Validation
- Inherits:
-
AbstractRule
- Object
- AbstractRule
- CodeDrivenDevelopment::Rule::Validation
- Defined in:
- lib/code_driven_development/rule/validation.rb
Instance Method Summary collapse
Methods inherited from AbstractRule
Constructor Details
This class inherits a constructor from CodeDrivenDevelopment::Rule::AbstractRule
Instance Method Details
#capable? ⇒ Boolean
4 5 6 7 8 |
# File 'lib/code_driven_development/rule/validation.rb', line 4 def capable? code.sexp_type == :call && code.sexp_body[0].nil? && code.sexp_body[1] == :validate end |
#test ⇒ Object
10 11 12 |
# File 'lib/code_driven_development/rule/validation.rb', line 10 def test test_context << TestComponent::OneLineTest.new("should validate_#{type}_of :#{field}") end |