Skip to content

Instantly share code, notes, and snippets.

@Overbryd
Created July 30, 2018 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Overbryd/3b162c28d3246cf7d8b871a67ad96162 to your computer and use it in GitHub Desktop.
Save Overbryd/3b162c28d3246cf7d8b871a67ad96162 to your computer and use it in GitHub Desktop.
diff --git a/elasticsearch-persistence/spec/repository/base_spec.rb b/elasticsearch-persistence/spec/repository/base_spec.rb
index fae1e7b..4a1fc4f 100644
--- a/elasticsearch-persistence/spec/repository/base_spec.rb
+++ b/elasticsearch-persistence/spec/repository/base_spec.rb
@@ -321,4 +321,22 @@ describe Elasticsearch::Persistence::Repository::Base do
it_behaves_like 'a base repository'
end
+
+ context 'when configuration changes on a descendant' do
+ let(:repository) { MyRepository }
+ let!(:old_class) { repository.superclass.klass }
+ let(:new_class) { Object }
+
+ before do
+ repository.klass = new_class
+ end
+
+ it 'applies to the descendant only' do
+ expect(repository.klass).to be(new_class)
+ end
+
+ it 'does not apply to the base class' do
+ expect(repository.superclass.klass).to be(old_class)
+ end
+ end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment