Sha256: 90764e18963439253c0f94834e8fcde55801eabddf6b3a3f62bac214bca25610

Contents?: true

Size: 588 Bytes

Versions: 2

Compression:

Stored size: 588 Bytes

Contents

require "tempfile"

module RSpec
  module Support
    def self.silently(cmd, via: :system)
      out    = Tempfile.new("dry-web-web_pipe-out")
      # RSpec::Support::Env.env
      result = ::Kernel.__send__(via, cmd, out: out.path, err: out.path)

      return if result

      out.rewind
      fail "#{cmd} failed:\n#{out.read}" # rubocop:disable Style/SignalException
    end

    module Silently
      private

      def silently(*args)
        Support.silently(*args)
      end
    end
  end
end

RSpec.configure do |config|
  config.include RSpec::Support::Silently, type: :cli
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-web-web_pipe-0.2.0 spec/support/silently.rb
dry-web-web_pipe-0.1.0 spec/support/silently.rb