lib/caricature/clr/isolator.rb in casualjim-caricature-0.5.0 vs lib/caricature/clr/isolator.rb in casualjim-caricature-0.6.0
- old
+ new
@@ -16,10 +16,11 @@
unless context.subject.respond_to?(:class_eval)
sklass = context.subject.class
instance = context.subject
end
@descriptor = ClrClassDescriptor.new sklass
- build_isolation sklass, (instance || sklass.new)
+ instance ||= sklass.new unless sklass.to_clr_type.is_abstract
+ build_isolation sklass, instance
end
# initializes the messaging strategy for the isolator
def initialize_messenger
@context.messenger = ClrClassMessenger.new @context.expectations, @subject
\ No newline at end of file