Sha256: 141ed4596335ca909a6df594cddc06e55423c984e61fc7bcf17aafdda8496b48

Contents?: true

Size: 812 Bytes

Versions: 11

Compression:

Stored size: 812 Bytes

Contents

require 'spec_helper'

describe Bogus::RecordsDoubleInteractions do
  let(:fake_registry) { stub }
  let(:doubled_interactions) { stub }
  let(:object) { Object.new }

  let(:records_double_interactions) { isolate(Bogus::RecordsDoubleInteractions) }

  it "records the call in double interaction repository" do
    stub(fake_registry).name(object) { :object_name }
    stub(doubled_interactions).record

    records_double_interactions.record(object, :method_name, [:foo, 1])

    doubled_interactions.should have_received.record(:object_name, :method_name, :foo, 1)
  end

  it "does not record the interaction if object is not a fake" do
    stub(fake_registry).name(object) { nil }
    dont_allow(doubled_interactions).record

    records_double_interactions.record(object, :method_name, [:foo, 1])
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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