Sha256: 9ac1d346ee6c2e44eb45c5656f1aee4a43f59aa55b74b0756077454f566e5e0f

Contents?: true

Size: 584 Bytes

Versions: 17

Compression:

Stored size: 584 Bytes

Contents

require "tempfile"

module RSpec
  module Support
    def self.silently(cmd, via: :system)
      out    = Tempfile.new("dry-web-roda-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

17 entries across 17 versions & 1 rubygems

Version Path
dry-web-roda-0.13.1 spec/support/silently.rb
dry-web-roda-0.13.0 spec/support/silently.rb
dry-web-roda-0.12.0 spec/support/silently.rb
dry-web-roda-0.11.0 spec/support/silently.rb
dry-web-roda-0.10.0 spec/support/silently.rb
dry-web-roda-0.9.1 spec/support/silently.rb
dry-web-roda-0.9.0 spec/support/silently.rb
dry-web-roda-0.8.0 spec/support/silently.rb
dry-web-roda-0.7.5 spec/support/silently.rb
dry-web-roda-0.7.4 spec/support/silently.rb
dry-web-roda-0.7.3 spec/support/silently.rb
dry-web-roda-0.7.2 spec/support/silently.rb
dry-web-roda-0.7.1 spec/support/silently.rb
dry-web-roda-0.7.0 spec/support/silently.rb
dry-web-roda-0.6.3 spec/support/silently.rb
dry-web-roda-0.6.2 spec/support/silently.rb
dry-web-roda-0.6.1 spec/support/silently.rb