Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

super basic failing arrays spec #1

Closed
wants to merge 1 commit into from

Conversation

jacobsmith
Copy link
Owner

No description provided.

foo = Foo.new

foo.bar = BarSchema.new(id: "original")
foo.bar = [BarSchema.new(id: "one"), BarSchema.new(id: "two")]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line fails with:

  1) Soulless::Serialization Arrays serializes as an array
     Failure/Error: super

     NoMethodError:
       Expected [#<BarSchema:0x007f9159050ab8 @changed_attributes={}, @id="one", @previously_changed={"id"=>[nil, "one"]}>, #<BarSchema:0x007f9159050680 @changed_attributes={}, @id="two", @previously_changed={"id"=>[nil, "two"]}>] to respond to #to_hash
     # /Users/jacobsmith/.rvm/gems/ruby-2.3.3/gems/virtus-1.0.5/lib/virtus/attribute_set.rb:196:in `coerce'
     # /Users/jacobsmith/.rvm/gems/ruby-2.3.3/gems/virtus-1.0.5/lib/virtus/attribute_set.rb:170:in `set'
     # /Users/jacobsmith/.rvm/gems/ruby-2.3.3/gems/virtus-1.0.5/lib/virtus/instance_methods.rb:17:in `initialize'
     # ./lib/soulless/model.rb:25:in `initialize'
     # /Users/jacobsmith/.rvm/gems/ruby-2.3.3/gems/virtus-1.0.5/lib/virtus/attribute/embedded_value.rb:37:in `new'
     # /Users/jacobsmith/.rvm/gems/ruby-2.3.3/gems/virtus-1.0.5/lib/virtus/attribute/embedded_value.rb:37:in `call'
     # /Users/jacobsmith/.rvm/gems/ruby-2.3.3/gems/virtus-1.0.5/lib/virtus/attribute.rb:104:in `coerce'
     # /Users/jacobsmith/.rvm/gems/ruby-2.3.3/gems/virtus-1.0.5/lib/virtus/attribute/coercible.rb:14:in `set'
     # /Users/jacobsmith/.rvm/gems/ruby-2.3.3/gems/virtus-1.0.5/lib/virtus/attribute_set.rb:146:in `block in define_writer_method'
     # ./lib/soulless/attributes.rb:22:in `block in define_writer'
     # ./spec/serialization_spec.rb:7:in `block (3 levels) in <top (required)>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant