Sha256: 2ad7865682df2a8394e72f646ab11dbf1a2625836dea24f244a2bb0dd090dfb2

Contents?: true

Size: 457 Bytes

Versions: 7

Compression:

Stored size: 457 Bytes

Contents

module Bogus
  class InteractionsRepository
    def initialize
      @interactions = Hash.new { |hash, fake_name| hash[fake_name] = [] }
    end

    def record(fake_name, method, *args, &block)
      @interactions[fake_name] << Interaction.new(method, args, &block)
    end

    def recorded?(fake_name, interaction)
      @interactions[fake_name].include?(interaction)
    end

    def for_fake(fake_name)
      @interactions[fake_name]
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bogus-0.1.0 lib/bogus/interactions_repository.rb
bogus-0.0.4 lib/bogus/interactions_repository.rb
bogus-0.0.3 lib/bogus/interactions_repository.rb
bogus-0.0.3.rc.2 lib/bogus/interactions_repository.rb
bogus-0.0.3.rc.1 lib/bogus/interactions_repository.rb
bogus-0.0.2 lib/bogus/interactions_repository.rb
bogus-0.0.1 lib/bogus/interactions_repository.rb