Is it possible for a double to bypass the
Instance check on a dry-struct attribute? For instance:
require 'dry-struct' require 'spec_helper' class B end class A < ::Dry::Struct include Dry::Types.module constructor_type(:schema) attribute :b, Instance(B).optional end describe 'something' do it 'test' do b = instance_double('B') expect( A.new(b: b) ).to be end end
I’ve tried to mock several methods from both
b and was not able to make this test pass.