Sha256: c3cae03be20475087763dcf2e5c35d790654f19f7ad51cba4b398f79b4342005

Contents?: true

Size: 942 Bytes

Versions: 2

Compression:

Stored size: 942 Bytes

Contents

require 'rspec/expectations/version'

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 [Boolean] The result
#
#     false:
#     * if command was not successful
#     true:
#     * if command was successful
#
#   @example Use matcher
#
#     RSpec.describe do
#       it { expect(last_command_started).to be_successfully_executed }
#       it { expect(last_command_started).not_to be_successfully_executed }
#       it { expect(last_command_started).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-1.0.0.pre.alpha.4 lib/aruba/matchers/command/be_successfully_executed.rb
aruba-1.0.0.pre.alpha.3 lib/aruba/matchers/command/be_successfully_executed.rb