Sha256: 2b74813aeb08c0ad6b45c77ba0d97b9f019f60d48f10a70d5bbaad7aba6966a7

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

require 'spec_helper'

describe Bogus::ResetsOverwrittenClasses do
  let(:classes) { [['Foo', :foo], ['Bar', :bar]] }
  let(:overwritten_classes) { stub }
  let(:overwrites_classes) { stub }

  let(:resets_overwritten_classes) { isolate(Bogus::ResetsOverwrittenClasses) }

  before do
    stub(overwritten_classes).classes { classes }
    stub(overwritten_classes).clear
    stub(overwrites_classes).overwrite

    resets_overwritten_classes.reset
  end

  it "overwrites back all of the overwritten classes" do
    expect(overwrites_classes).to have_received.overwrite('Foo', :foo)
    expect(overwrites_classes).to have_received.overwrite('Bar', :bar)
  end

  it "clears the overwritten classes" do
    expect(overwritten_classes).to have_received.clear
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bogus-0.1.5 spec/bogus/fakes/resets_overwritten_classes_spec.rb