Sha256: b79204869c5e5bf96dfd5c7aa296feba42359e663e002e498de8e9144078ed90

Contents?: true

Size: 497 Bytes

Versions: 11

Compression:

Stored size: 497 Bytes

Contents

require 'spec_helper'

describe Bogus::FakeRegistry do
  let(:fake_registry) { Bogus::FakeRegistry.new }

  it "knows the fake's names" do
    object = Object.new

    fake_registry.store(:name, object)

    fake_registry.name(object).should == :name
  end

  it "returns name based on object identity" do
    example = Struct.new(:id)

    object = example.new(1)
    duplicate = example.new(1)

    fake_registry.store(:object, object)

    fake_registry.name(duplicate).should be_nil
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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