Sha256: aef9f8d0b9ec005e31206bbabe516f6a444efb38598f0522bd51508ec073c828

Contents?: true

Size: 736 Bytes

Versions: 3

Compression:

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

    expect(overwritten_classes.classes).to eq [["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

    expect(overwritten_classes.classes).to eq []
  end

  it "returns an empty array with no classes" do
    expect(overwritten_classes.classes).to eq []
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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