Closed shingara closed 9 years ago
I really like to get the problem solved, but I do not like we are dynamically modifying global state. Also when this state is the class hierarchy of IceNine.
What about a factory that returns an IceNine / Adamantium module that behaves like we want?
module MyApp
Immutable = Adamantium.build(:no_freeze => [...], :memoizer => :freeze, ...)
class DomainEntity
include Immutable
end
end
I test the code with const_set
and seems not work in regard of my spec
@mbj that's an interesting case. I do lean toward figuring out how to do what you suggest, it's much nicer for testing and keeps things out of global state. Maybe we should all discuss how that would work and if it makes sense here or in Adamantium.
I rebase my pull request with all of comment do on previous pull request
Closing this PR for no activity.
If you want not freeze some namespace you can do
IceNine.no_freeze([RSpec, Mocha])
fixed #2