Sha256: ea9ffa42378fcc65c6531f21e0704ce9a51f64b80dfe86a3974291c295515d2b

Contents?: true

Size: 590 Bytes

Versions: 24

Compression:

Stored size: 590 Bytes

Contents

#!/usr/bin/env ruby 


module Flapjack
  module Persistence
    class MockPersistenceBackend
      def initialize(options={})
        @options = options
        @config = OpenStruct.new(@options)
        @queue = []
        @log = @config.log
      end

      # log if the method is called (essentially, these are dodgy mocks)
      %w(any_parents_failed? save create_event).each do |method|
        class_eval <<-HERE
          def #{method}(*args)
            @log.info("method #{method} was called on MockPersistenceBackend")
          end
        HERE
      end
    
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
flapjack-0.6.43 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.42 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.41 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.40 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.39 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.38 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.37 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.36 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.35 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.34 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.33 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.32 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.31 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.30 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.29 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.28 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.27 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.26 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.25 spec.old/persistence/mock_persistence_backend.rb
flapjack-0.6.24 spec.old/persistence/mock_persistence_backend.rb