Sha256: 1d08c6f503cb854812db5f7f41bffd30ad32b6d9b144a8791be27fe6f1e104d2

Contents?: true

Size: 637 Bytes

Versions: 2

Compression:

Stored size: 637 Bytes

Contents

require 'spec_helper'

describe Bogus::RegistersCreatedFakes do
  let(:fake_registry) { stub }
  let(:creates_fakes) { stub }

  let(:registers_created_fakes) { isolate(Bogus::RegistersCreatedFakes) }

  before do
    stub(fake_registry).store
    stub(creates_fakes).create { :the_fake }
  end

  it "registers the fakes created by creates_fakes" do
    registers_created_fakes.create(:foo, as: :instance) { Object }

    fake_registry.should have_received.store(:foo, :the_fake)
  end

  it "returns the created fake" do
    fake = registers_created_fakes.create(:foo, as: :instance) { Object }

    fake.should == :the_fake
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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