virtus 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +10 -2
- data/Guardfile +9 -0
- data/README.md +12 -8
- data/TODO +0 -35
- data/config/flay.yml +1 -1
- data/config/site.reek +3 -1
- data/lib/virtus.rb +1 -0
- data/lib/virtus/attribute.rb +1 -1
- data/lib/virtus/attribute/collection.rb +2 -2
- data/lib/virtus/attribute/default_value/from_symbol.rb +2 -2
- data/lib/virtus/attribute_set.rb +4 -17
- data/lib/virtus/attributes_accessor.rb +22 -20
- data/lib/virtus/class_methods.rb +1 -1
- data/lib/virtus/coercion/hash.rb +1 -1
- data/lib/virtus/coercion/object.rb +1 -1
- data/lib/virtus/coercion/string.rb +20 -7
- data/lib/virtus/coercion/time_coercions.rb +5 -1
- data/lib/virtus/instance_methods.rb +8 -8
- data/lib/virtus/support/type_lookup.rb +24 -8
- data/lib/virtus/value_object/equalizer.rb +3 -2
- data/lib/virtus/version.rb +1 -1
- data/spec/shared/options_class_method.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/virtus/attribute/class_methods/determine_type_spec.rb +1 -7
- data/spec/unit/virtus/attribute/coerce_spec.rb +2 -2
- data/spec/unit/virtus/attribute/collection/coerce_and_append_member_spec.rb +16 -0
- data/spec/unit/virtus/attribute/collection/coerce_spec.rb +20 -7
- data/spec/unit/virtus/attribute/collection/member_coercion/coerce_and_append_member_spec.rb +18 -0
- data/spec/unit/virtus/attribute/collection/member_type_spec.rb +17 -0
- data/spec/unit/virtus/attribute/collection/new_collection_spec.rb +9 -0
- data/spec/unit/virtus/attribute/default_value/class_methods/build_spec.rb +25 -0
- data/spec/unit/virtus/attribute/default_value/evaluate_spec.rb +0 -43
- data/spec/unit/virtus/attribute/default_value/from_callable/class_methods/handle_spec.rb +20 -0
- data/spec/unit/virtus/attribute/default_value/from_callable/evaluate_spec.rb +21 -0
- data/spec/unit/virtus/attribute/default_value/from_clonable/class_methods/handle_spec.rb +20 -0
- data/spec/unit/virtus/attribute/default_value/from_clonable/evaluate_spec.rb +22 -0
- data/spec/unit/virtus/attribute/default_value/from_symbol/class_methods/handle_spec.rb +20 -0
- data/spec/unit/virtus/attribute/default_value/from_symbol/evaluate_spec.rb +18 -0
- data/spec/unit/virtus/attribute_set/element_set_spec.rb +5 -4
- data/spec/unit/virtus/attributes_accessor/define_reader_method_spec.rb +36 -0
- data/spec/unit/virtus/attributes_accessor/define_writer_method_spec.rb +36 -0
- data/spec/unit/virtus/coercion/array/{to_set_spec.rb → class_methods/to_set_spec.rb} +0 -0
- data/spec/unit/virtus/coercion/{class_name_reference_spec.rb → class_methods/element_reference_spec.rb} +0 -0
- data/spec/unit/virtus/coercion/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/virtus/coercion/decimal/class_methods/to_decimal_spec.rb +10 -0
- data/spec/unit/virtus/coercion/float/class_methods/to_float_spec.rb +10 -0
- data/spec/unit/virtus/coercion/integer/class_methods/to_integer_spec.rb +10 -0
- data/spec/unit/virtus/coercion/numeric/class_methods/to_decimal_spec.rb +0 -0
- data/spec/unit/virtus/coercion/numeric/class_methods/to_float_spec.rb +0 -0
- data/spec/unit/virtus/coercion/numeric/class_methods/to_integer_spec.rb +0 -0
- data/spec/unit/virtus/coercion/numeric/class_methods/to_string_spec.rb +0 -0
- data/spec/unit/virtus/coercion/object/class_methods/to_string_spec.rb +1 -1
- data/spec/unit/virtus/coercion/string/class_methods/to_symbol_spec.rb +10 -0
- data/spec/unit/virtus/coercion/time/class_methods/to_integer_spec.rb +11 -0
- data/spec/unit/virtus/instance_methods/attributes_spec.rb +25 -0
- data/spec/unit/virtus/instance_methods/initialize_spec.rb +42 -0
- data/spec/unit/virtus/type_lookup/class_methods/extended_spec.rb +10 -0
- data/spec/unit/virtus/value_object/class_methods/attribute_spec.rb +16 -0
- data/spec/unit/virtus/value_object/equalizer/append_spec.rb +61 -0
- data/virtus.gemspec +4 -3
- metadata +80 -75
- 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
|