Skip to content

Commit

Permalink
Fix around blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields authored and p committed May 19, 2022
1 parent 685ab96 commit 7b9e174
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions spec/mongoid/fields/field_types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
describe Mongoid::Fields::FieldTypes do

around do |example|
mapping = described_class::DEFAULT_MAPPING.dup
described_class.instance_variable_set(:@mapping, mapping)
described_class.instance_variable_set(:@mapping, described_class::DEFAULT_MAPPING.dup)
example.run
described_class.instance_variable_set(:@mapping, mapping)
described_class.instance_variable_set(:@mapping, described_class::DEFAULT_MAPPING.dup)
end

describe '.get' do
Expand Down
5 changes: 2 additions & 3 deletions spec/mongoid/fields_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1789,10 +1789,9 @@ class DiscriminatorChild2 < DiscriminatorParent
context '.type method' do
around do |example|
klass = Mongoid::Fields::FieldTypes
mapping = klass::DEFAULT_MAPPING.dup
klass.instance_variable_set(:@mapping, mapping)
klass.instance_variable_set(:@mapping, klass::DEFAULT_MAPPING.dup)
example.run
klass.instance_variable_set(:@mapping, mapping)
klass.instance_variable_set(:@mapping, klass::DEFAULT_MAPPING.dup)
end

it 'can define a custom type' do
Expand Down

0 comments on commit 7b9e174

Please sign in to comment.