describe Skala::Adapter do let(:adapter) { described_class.new() } context "when a class is derived from #{described_class}" do context "when the derived class overwrites .initialize" do context "when the derived class calls super inside the overwritten .initalize" do let(:derived_class) do Class.new(described_class) do def initialize super self.class.load_locales_from_directory(File.expand_path("#{File.dirname(__FILE__)}/../assets/locales")) end end end let(:derived_class_instance) do derived_class.new end it "has access to the superclass locales" do translation_key_known_by_superclass = "field_names.creator" translation = derived_class_instance.translate(translation_key_known_by_superclass, locale: :de) expected_translation = derived_class_instance.class.class_variable_get(:@@locales)["de"]["field_names"]["creator"] expect(translation).to eq(expected_translation) end end end end end