Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
Add a spec
Browse files Browse the repository at this point in the history
  • Loading branch information
GCorbel committed Feb 20, 2024
1 parent d3f54fd commit efd11e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/rspec/mocks/mutate_const_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ def change_const_value_to(value)
expect(recursive_const_defined?(const_name)).to be_falsey
end

it 'gives the same subclasses after rspec clears its mocks' do
original_subclasses = TestClass.subclasses
stub_const(const_name, Class.new(TestClass))
reset_rspec_mocks
expect(TestClass.subclasses).to eq(original_subclasses)
end

it 'returns nil' do
expect(hide_const(const_name)).to be_nil
end
Expand Down

0 comments on commit efd11e7

Please sign in to comment.