fix misspelled include
* Adds spec and spec/integration to LOAD_PATH for simplified requires when specing. no '../../../' hazard is needed. * Uses value.to_s instead of value.to_str on 1.8 to determine string length. #to_str is not defined for nil. * Require backports on ruby-1.8 for Enumerable#each_with_object
Fix minor problems.
* Add Rational to numericallness validator * Make sure options are not truncated for PrimitiveType::Virtus * Use object.class.name instead of object.model.name for default MessageTransformer * Add an explict virtus development dependency. It breaks no specs. So no specs are changed. Virtus primitive validator clearly needs more specs.
Context was a holdover from DM. Its purpose is to allow related instances to attempt validation in the same context as the root instance is validated when validating through a graph of objects. This global was used because DM did not explicitly pass the root object's validation context to related instances as they were validated (in DM the save (& therefore #valid?) call cascades via #save_parents & #save_children). Since Aequitas has no concept of validating a graph of objects (at this point), this feature is not needed. If, at some point in the future, Aequitas needs to be able to validate a graph of objects, we can devise a better implementation at that time.
In other words: specify one method per spec file.
Specifically: #define_context and #add_rules_to_context.
Specifically: #violation_info, #violation_values, and #violation_data.
Very few Rule subclasses need access to the resource itself, and those few that do (Rule::Block, Rule::Confirmation, Rule::Method) can override #validate to gain access to it. Renamed Rule::Length#valid_length? -> #expected_length?, Rule::PrimitiveType#primitive? -> #expected_type?, and Rule::Value#valid_value? -> #expected_value?. Replaced Rule::Format#valid? with #expected_format?
Introduced Violation::Rule and Violation::Message subclasses which are used where appropriate.
fixed a tiny typo in ContextualRuleSet#concat