aetherknight / recursive-open-struct

OpenStruct subclass that returns nested hash attributes as RecursiveOpenStructs
Other
276 stars 54 forks source link

tests fail with ruby version 2.7 NoMethodError: undefined method `[]=' for nil:NilClass #62

Closed pravi closed 4 years ago

pravi commented 4 years ago

Tests are failing with ruby 2.7

44) RecursiveOpenStruct recursive behavior recursing over arrays modifying an array and recursing over it after appending a hash to an array can have new values be set
      Failure/Error: modifiable[new_ostruct_member!($1.to_sym)] = args[0]

      NoMethodError:
        undefined method `[]=' for nil:NilClass
      # ./lib/recursive_open_struct.rb:82:in `method_missing'
      # ./spec/recursive_open_struct/recursion_spec.rb:272:in `block (6 levels) in <top (required)>'

Finished in 0.03504 seconds (files took 0.21339 seconds to load)
114 examples, 44 failures
benlangfeld commented 4 years ago

Need to use modifiable? instead.

aetherknight commented 4 years ago

I just released v1.1.1, which incorporates #64 and then adds some backwards compatibility support to continue supporting JRuby's current stable version.

Policy is one of supporting still-supported versions of Ruby. 2.3.x is no longer supported, but JRuby 9.1.x.x tracks 2.3.x feature set, so Rubies back to 2.0.0 are still incidentally supported.