diff --git a/spec/concurrent/struct_shared.rb b/spec/concurrent/struct_shared.rb index 6dd91870..4c73a9e4 100644 --- a/spec/concurrent/struct_shared.rb +++ b/spec/concurrent/struct_shared.rb @@ -27,13 +27,15 @@ end it 'ignores methods on ancestor classes' do - ancestor = described_class.ancestors.first - ancestor.class_eval { def foo; end } + ancestor = described_class.ancestors.last + ancestor.class_eval { def foo(bar); end } clazz = described_class.new(:foo) - expect{ described_class.const_get(clazz.to_s) }.to raise_error(NameError) - expect(clazz).to be_a Class - expect(clazz.ancestors).to include described_class + struct = clazz.new + + expect(struct).to respond_to :foo + method = struct.method(:foo) + expect(method.arity).to eq 0 ancestor.send :remove_method, :foo end