Sha256: 23289bd062e0250baaec75fe03d33ae99e57f69b5e19a50e79cdf77ce5fef6ea

Contents?: true

Size: 632 Bytes

Versions: 3

Compression:

Stored size: 632 Bytes

Contents

require 'spec_helper'

describe Bogus::OverwritesClasses do
  module SampleOuterModule
    module SampleModule
      class SampleClass
      end
    end
  end

  let(:new_class) { Class.new }
  let(:overwrites_classes) { Bogus::OverwritesClasses.new }

  it "overwrites nested classes" do
    overwrites_classes.overwrite('SampleOuterModule::SampleModule::SampleClass', new_class)

    expect(SampleOuterModule::SampleModule::SampleClass).to equal(new_class)
  end

  it "overwrites top level classes" do
    overwrites_classes.overwrite('SampleOuterModule', new_class)

    expect(SampleOuterModule).to equal(new_class)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bogus-0.1.7 spec/bogus/fakes/overwrites_classes_spec.rb
bogus-0.1.6 spec/bogus/fakes/overwrites_classes_spec.rb
bogus-0.1.5 spec/bogus/fakes/overwrites_classes_spec.rb