Sha256: ff7df6754b9743a44d71eef3ea25790352d9877b23d98fa33e4b1294aa9bd021

Contents?: true

Size: 724 Bytes

Versions: 9

Compression:

Stored size: 724 Bytes

Contents

require 'spec_helper'

describe Bogus::OverwrittenClasses do
  let(:overwritten_classes) { Bogus::OverwrittenClasses.new }

  let(:klass) { Class.new }

  it "adds classes" do
    overwritten_classes.add("Foo::Bar", klass)
    overwritten_classes.add("Baz::Bam", klass)

    overwritten_classes.classes.should == [["Foo::Bar", klass],
                                           ["Baz::Bam", klass]]
  end

  it "clears overwritten classes" do
    overwritten_classes.add("Foo::Bar", klass)
    overwritten_classes.add("Baz::Bam", klass)
    overwritten_classes.clear

    overwritten_classes.classes.should == []
  end

  it "returns an empty array with no classes" do
    overwritten_classes.classes.should == []
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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