Sha256: ea0f390b64e5b76e875bf7d5dbf6e5fd2eaf2d9e9373be26b99b2bc6be5b8e88

Contents?: true

Size: 526 Bytes

Versions: 11

Compression:

Stored size: 526 Bytes

Contents

# @private
module Evil::Client::RSpec
  #
  # Container to chain settings for stubbing operation(s)
  #
  class BaseStub
    include RSpec::Mocks::ExampleMethods
    include RSpec::Matchers

    def with(condition = nil, &block)
      update(condition || block)
    end

    private

    def initialize(klass, name = nil, condition: nil)
      @klass     = klass
      @name      = name
      @condition = condition
    end

    def update(condition)
      self.class.new @klass, @name, condition: condition
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
evil-client-3.2.0 lib/evil/client/rspec/base_stub.rb
evil-client-3.1.0 lib/evil/client/rspec/base_stub.rb
evil-client-3.0.4 lib/evil/client/rspec/base_stub.rb
evil-client-3.0.3 lib/evil/client/rspec/base_stub.rb
evil-client-3.0.2 lib/evil/client/rspec/base_stub.rb
evil-client-3.0.1 lib/evil/client/rspec/base_stub.rb
evil-client-3.0.0 lib/evil/client/rspec/base_stub.rb
evil-client-2.1.1 lib/evil/client/rspec/base_stub.rb
evil-client-2.1.0 lib/evil/client/rspec/base_stub.rb
evil-client-2.0.0 lib/evil/client/rspec/base_stub.rb
evil-client-1.1.0 lib/evil/client/rspec/base_stub.rb