Sha256: cbfd4c0698ec425e47da203c2c1de21b6d3918f4f6fef7006c51d3da79258e35

Contents?: true

Size: 624 Bytes

Versions: 9

Compression:

Stored size: 624 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)

    SampleOuterModule::SampleModule::SampleClass.should equal(new_class)
  end

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

    SampleOuterModule.should equal(new_class)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bogus-0.1.4 spec/bogus/fakes/overwrites_classes_spec.rb
bogus-0.1.3 spec/bogus/overwrites_classes_spec.rb
bogus-0.1.2 spec/bogus/overwrites_classes_spec.rb
bogus-0.1.1 spec/bogus/overwrites_classes_spec.rb
bogus-0.1.0 spec/bogus/overwrites_classes_spec.rb
bogus-0.0.4 spec/bogus/overwrites_classes_spec.rb
bogus-0.0.3 spec/bogus/overwrites_classes_spec.rb
bogus-0.0.3.rc.2 spec/bogus/overwrites_classes_spec.rb
bogus-0.0.3.rc.1 spec/bogus/overwrites_classes_spec.rb