test/requirement_spec: use stub_const

This commit is contained in:
Bo Anderson 2024-01-08 18:38:20 +00:00
parent 50b0940c72
commit 43e5352074
No known key found for this signature in database

View File

@ -163,11 +163,7 @@ describe Requirement do
let(:klass) { self.class.const_get(const) }
before do
self.class.const_set(const, Class.new(described_class))
end
after do
self.class.send(:remove_const, const)
stub_const const.to_s, Class.new(described_class)
end
its(:name) { is_expected.to eq("foo") }