lib/structure/double.rb in structure-1.0.2 vs lib/structure/double.rb in structure-1.0.3
- old
+ new
@@ -13,10 +13,17 @@
end
klass.module_eval do
def initialize(data = {})
data.each do |key, value|
- value.freeze unless value.is_a?(Structure)
+ unless value.is_a?(Structure) ||
+ (
+ defined?(RSpec::Mocks::Double) &&
+ value.is_a?(RSpec::Mocks::Double)
+ )
+ value.freeze
+ end
+
instance_variable_set(:"@#{key}", value)
end
end
attribute_names.each do |name|