lib/flexmock/mock_builder.rb in flexmock-2.0.5 vs lib/flexmock/mock_builder.rb in flexmock-2.0.6

- old
+ new

@@ -103,12 +103,18 @@ def parse_create_symbol(args, opts) case args.first when :base, :safe opts.safe_mode = (args.shift == :safe) opts.domain_obj = args.shift - when :on - args.shift - opts.base_class = args.shift + when :on, :strict + if args.shift == :strict + if !opts.domain_obj + raise ArgumentError, "cannot use :strict outside a partial mock" + end + opts.base_class = opts.domain_obj.class + else + opts.base_class = args.shift + end opts.name ||= "#{opts.base_class} Mock" else CONTAINER_HELPER.extensions.each do |ext| handled = ext.handle(args, opts) return true if handled