virtus 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/Changelog.md +10 -2
  2. data/Guardfile +9 -0
  3. data/README.md +12 -8
  4. data/TODO +0 -35
  5. data/config/flay.yml +1 -1
  6. data/config/site.reek +3 -1
  7. data/lib/virtus.rb +1 -0
  8. data/lib/virtus/attribute.rb +1 -1
  9. data/lib/virtus/attribute/collection.rb +2 -2
  10. data/lib/virtus/attribute/default_value/from_symbol.rb +2 -2
  11. data/lib/virtus/attribute_set.rb +4 -17
  12. data/lib/virtus/attributes_accessor.rb +22 -20
  13. data/lib/virtus/class_methods.rb +1 -1
  14. data/lib/virtus/coercion/hash.rb +1 -1
  15. data/lib/virtus/coercion/object.rb +1 -1
  16. data/lib/virtus/coercion/string.rb +20 -7
  17. data/lib/virtus/coercion/time_coercions.rb +5 -1
  18. data/lib/virtus/instance_methods.rb +8 -8
  19. data/lib/virtus/support/type_lookup.rb +24 -8
  20. data/lib/virtus/value_object/equalizer.rb +3 -2
  21. data/lib/virtus/version.rb +1 -1
  22. data/spec/shared/options_class_method.rb +1 -1
  23. data/spec/spec_helper.rb +1 -1
  24. data/spec/unit/virtus/attribute/class_methods/determine_type_spec.rb +1 -7
  25. data/spec/unit/virtus/attribute/coerce_spec.rb +2 -2
  26. data/spec/unit/virtus/attribute/collection/coerce_and_append_member_spec.rb +16 -0
  27. data/spec/unit/virtus/attribute/collection/coerce_spec.rb +20 -7
  28. data/spec/unit/virtus/attribute/collection/member_coercion/coerce_and_append_member_spec.rb +18 -0
  29. data/spec/unit/virtus/attribute/collection/member_type_spec.rb +17 -0
  30. data/spec/unit/virtus/attribute/collection/new_collection_spec.rb +9 -0
  31. data/spec/unit/virtus/attribute/default_value/class_methods/build_spec.rb +25 -0
  32. data/spec/unit/virtus/attribute/default_value/evaluate_spec.rb +0 -43
  33. data/spec/unit/virtus/attribute/default_value/from_callable/class_methods/handle_spec.rb +20 -0
  34. data/spec/unit/virtus/attribute/default_value/from_callable/evaluate_spec.rb +21 -0
  35. data/spec/unit/virtus/attribute/default_value/from_clonable/class_methods/handle_spec.rb +20 -0
  36. data/spec/unit/virtus/attribute/default_value/from_clonable/evaluate_spec.rb +22 -0
  37. data/spec/unit/virtus/attribute/default_value/from_symbol/class_methods/handle_spec.rb +20 -0
  38. data/spec/unit/virtus/attribute/default_value/from_symbol/evaluate_spec.rb +18 -0
  39. data/spec/unit/virtus/attribute_set/element_set_spec.rb +5 -4
  40. data/spec/unit/virtus/attributes_accessor/define_reader_method_spec.rb +36 -0
  41. data/spec/unit/virtus/attributes_accessor/define_writer_method_spec.rb +36 -0
  42. data/spec/unit/virtus/coercion/array/{to_set_spec.rb → class_methods/to_set_spec.rb} +0 -0
  43. data/spec/unit/virtus/coercion/{class_name_reference_spec.rb → class_methods/element_reference_spec.rb} +0 -0
  44. data/spec/unit/virtus/coercion/class_methods/primitive_spec.rb +13 -0
  45. data/spec/unit/virtus/coercion/decimal/class_methods/to_decimal_spec.rb +10 -0
  46. data/spec/unit/virtus/coercion/float/class_methods/to_float_spec.rb +10 -0
  47. data/spec/unit/virtus/coercion/integer/class_methods/to_integer_spec.rb +10 -0
  48. data/spec/unit/virtus/coercion/numeric/class_methods/to_decimal_spec.rb +0 -0
  49. data/spec/unit/virtus/coercion/numeric/class_methods/to_float_spec.rb +0 -0
  50. data/spec/unit/virtus/coercion/numeric/class_methods/to_integer_spec.rb +0 -0
  51. data/spec/unit/virtus/coercion/numeric/class_methods/to_string_spec.rb +0 -0
  52. data/spec/unit/virtus/coercion/object/class_methods/to_string_spec.rb +1 -1
  53. data/spec/unit/virtus/coercion/string/class_methods/to_symbol_spec.rb +10 -0
  54. data/spec/unit/virtus/coercion/time/class_methods/to_integer_spec.rb +11 -0
  55. data/spec/unit/virtus/instance_methods/attributes_spec.rb +25 -0
  56. data/spec/unit/virtus/instance_methods/initialize_spec.rb +42 -0
  57. data/spec/unit/virtus/type_lookup/class_methods/extended_spec.rb +10 -0
  58. data/spec/unit/virtus/value_object/class_methods/attribute_spec.rb +16 -0
  59. data/spec/unit/virtus/value_object/equalizer/append_spec.rb +61 -0
  60. data/virtus.gemspec +4 -3
  61. metadata +80 -75
  62. data/spec/unit/virtus/attribute_set/parent_spec.rb +0 -11
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Virtus::AttributeSet, '#parent' do
4
- subject { object.parent }
5
-
6
- let(:attributes) { [] }
7
- let(:parent) { described_class.new }
8
- let(:object) { described_class.new(parent, attributes) }
9
-
10
- it { should equal(parent) }
11
- end