Class: RSpec::ShellCommand::Matchers::Success

Inherits:
Base
  • Object
show all
Defined in:
lib/rspec/shell_command/matchers/success.rb

Overview

Provide implementation of success matcher

Check whether given command successed

Instance Method Summary collapse

Methods inherited from Base

#actual_status, #actual_status_message, #make_expected_and_got_message, #matches?

Instance Method Details

#descriptionObject



23
24
25
# File 'lib/rspec/shell_command/matchers/success.rb', line 23

def description
  'success'
end

#failure_messageObject



15
16
17
# File 'lib/rspec/shell_command/matchers/success.rb', line 15

def failure_message
  "expect command have to successed, but #{actual_status_message}"
end

#failure_message_when_negatedObject



19
20
21
# File 'lib/rspec/shell_command/matchers/success.rb', line 19

def failure_message_when_negated
  'expect command have not to successed, but successed'
end

#perform_match(actual) ⇒ Object



11
12
13
# File 'lib/rspec/shell_command/matchers/success.rb', line 11

def perform_match(actual)
  actual.status.success?
end