Sha256: 6a7f61aa12efdea9037b569c692331f3fb3de539535857ea2e13dba92e68d39a

Contents?: true

Size: 620 Bytes

Versions: 2

Compression:

Stored size: 620 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

2 entries across 2 versions & 1 rubygems

Version Path
bogus-0.0.2 spec/bogus/overwrites_classes_spec.rb
bogus-0.0.1 spec/bogus/overwrites_classes_spec.rb