Class: Spec::Client::Http::Matcher::TransactionMatchers::BeSuccess

Inherits:
VerboseHttpMatcher show all
Defined in:
lib/spec/client/http/matcher/transaction_matchers.rb

Instance Attribute Summary

Attributes inherited from VerboseHttpMatcher

#transaction

Instance Method Summary collapse

Methods inherited from VerboseHttpMatcher

#transaction_info

Instance Method Details

#failure_messageObject



57
58
59
# File 'lib/spec/client/http/matcher/transaction_matchers.rb', line 57

def failure_message
  "expected success? to return true, got false" + "\n" + super
end

#matches?(transaction) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
55
# File 'lib/spec/client/http/matcher/transaction_matchers.rb', line 52

def matches?(transaction)
  super(transaction) && transaction.success?
  #(200..299).include? transaction.response.code
end

#negative_failure_messageObject



61
62
63
# File 'lib/spec/client/http/matcher/transaction_matchers.rb', line 61

def negative_failure_message
  "expected success? to return false, got true" + "\n" + super
end