Sha256: a3d253a25235a8ccdd641a9f0cb6d0c857b946b365023843d0c130eb5f7d1abb

Contents?: true

Size: 894 Bytes

Versions: 2

Compression:

Stored size: 894 Bytes

Contents

require 'aruba/matchers/command/have_exit_status'
require 'aruba/matchers/command/have_finished_in_time'

# @!method be_successfuly_executed
#   This matchers checks if execution of <command> was successful
#
#   @return [TrueClass, FalseClass] The result
#
#     false:
#     * if command was not successful
#     true:
#     * if command was successful
#
#   @example Use matcher
#
#     RSpec.describe do
#       it { expect(last_command).to be_successfully_executed }
#       it { expect(last_command).not_to be_successfully_executed }
#       it { expect(last_command).to have_failed_running }
#     end
RSpec::Matchers.define :be_successfully_executed do
  match do |actual|
    @old_actual = actual
    @actual     = @old_actual.commandline

    expect(@old_actual).to have_exit_status(0)
  end
end

RSpec::Matchers.define_negated_matcher :have_failed_running, :be_successfully_executed

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aruba-0.8.0.pre2 lib/aruba/matchers/command/be_successfully_executed.rb
aruba-0.8.0.pre lib/aruba/matchers/command/be_successfully_executed.rb