Skip to content

Commit 685ab96

Browse files
johnnyshieldsp
authored andcommitted
Fix spec
1 parent f70ef85 commit 685ab96

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/mongoid/fields_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,9 +1787,12 @@ class DiscriminatorChild2 < DiscriminatorParent
17871787
describe '.configure DSL' do
17881788

17891789
context '.type method' do
1790-
after do
1790+
around do |example|
17911791
klass = Mongoid::Fields::FieldTypes
1792-
klass.instance_variable_set(:@mapping, klass::DEFAULT_MAPPING.dup)
1792+
mapping = klass::DEFAULT_MAPPING.dup
1793+
klass.instance_variable_set(:@mapping, mapping)
1794+
example.run
1795+
klass.instance_variable_set(:@mapping, mapping)
17931796
end
17941797

17951798
it 'can define a custom type' do

0 commit comments

Comments
 (0)