Skip to content

Commit a8ff052

Browse files
committed
Refactor RSpec for AnnotateModels.annotate_model_file
1 parent 782fe37 commit a8ff052

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spec/lib/annotate/annotate_models_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,12 +2708,14 @@ class Foo < ActiveRecord::Base; end
27082708
allow(Foo).to receive(:table_exists?) { false }
27092709
end
27102710

2711+
subject do
2712+
AnnotateModels.annotate_model_file([], 'foo.rb', nil, {})
2713+
end
2714+
27112715
after { Object.send :remove_const, 'Foo' }
27122716

27132717
it 'skips attempt to annotate if no table exists for model' do
2714-
annotate_model_file = AnnotateModels.annotate_model_file([], 'foo.rb', nil, {})
2715-
2716-
expect(annotate_model_file).to eq nil
2718+
is_expected.to eq nil
27172719
end
27182720
end
27192721
end

0 commit comments

Comments
 (0)