sineed / neo4j-rspec

MIT License
10 stars 13 forks source link

Property values #22

Closed vaughncm closed 6 years ago

vaughncm commented 7 years ago

Our team has noticed that in validating the type of property definition that if you have the following:

class Modely
  include Neo4j::ActiveNode
  property :a_model_string, type: String
end

if you try to verify the property type in the specs like so:

describe Modely do
  it { is_expected.to define_property(:a_model_string, :Integer)
end

That it would be ✅ even though the type expected to be defined was not correct on the system under test (the Modely). We expect an error message that says:

expected the Modely  model to have a `Integer` property a_model_string

This was due to Module being inclusive on the verification previously which always included those types. In order to correct this we've added some additional logic to "constantize" the type that we are passing in to verify it against the actual type that neo4jrb uses for the model.

The only caveat with the "constantize" is that :Boolean is a special Neo4j::Shared::Boolean type so we have to have a special case for that.

vaughncm commented 7 years ago

Also we're noticing failures on Neo4j 6 builds in Travis but it's not related to anything we did seemingly. Neo4j 7 seems to be building fine. Any help would be appreciated. I know it's been ~9 months since any builds were run so I don't know if by chance something has changed on Travis or a dependency.

leviwilson commented 6 years ago

@cheerfulstoic updated this with master and the builds are now ✅