Sha256: ca36727c989c349e6586bbb3e17bd46a2b2129921aa75d24edfbaba54c639121

Contents?: true

Size: 993 Bytes

Versions: 24

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

require 'bolt/result'
require 'bolt/util'

module BoltSpec
  module Plans
    class PublishStub < ActionStub
      def return
        raise "return is not implemented for out module functions"
      end

      def return_for_targets(_data)
        raise "return_for_targets is not implemented for out module functions"
      end

      def always_return(_data)
        raise "always_return is not implemented for out module functions"
      end

      def error_with(_data)
        raise "error_with is not implemented for out module functions"
      end

      def matches(message)
        if @invocation[:options] && message != @invocation[:options]
          return false
        end

        true
      end

      def call(_event)
        @calls += 1
      end

      def parameters
        @invocation[:options]
      end

      # Public methods

      def with_params(params)
        @invocation[:options] = params
        self
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
bolt-4.0.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.29.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.28.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.27.4 lib/bolt_spec/plans/publish_stub.rb
bolt-3.27.2 lib/bolt_spec/plans/publish_stub.rb
bolt-3.27.1 lib/bolt_spec/plans/publish_stub.rb
bolt-3.26.2 lib/bolt_spec/plans/publish_stub.rb
bolt-3.26.1 lib/bolt_spec/plans/publish_stub.rb
bolt-3.25.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.24.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.23.1 lib/bolt_spec/plans/publish_stub.rb
bolt-3.23.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.22.1 lib/bolt_spec/plans/publish_stub.rb
bolt-3.22.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.21.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.20.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.19.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.18.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.17.0 lib/bolt_spec/plans/publish_stub.rb
bolt-3.16.1 lib/bolt_spec/plans/publish_stub.rb