Class: Spec::Client::Http::Matcher::TransactionMatchers::VerboseHttpMatcher

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

Direct Known Subclasses

BeRedirect, BeSuccess

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#transactionObject

Returns the value of attribute transaction.



7
8
9
# File 'lib/spec/client/http/matcher/transaction_matchers.rb', line 7

def transaction
  @transaction
end

Instance Method Details

#failure_messageObject



23
24
25
# File 'lib/spec/client/http/matcher/transaction_matchers.rb', line 23

def failure_message
  transaction_info
end

#matches?(transaction) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/spec/client/http/matcher/transaction_matchers.rb', line 9

def matches?(transaction)
  @transaction = transaction
  return transaction.is_a?(Spec::Client::Http::Transaction)
end

#negative_failure_messageObject



27
28
29
# File 'lib/spec/client/http/matcher/transaction_matchers.rb', line 27

def negative_failure_message
  transaction_info
end

#transaction_infoObject



14
15
16
17
18
19
20
21
# File 'lib/spec/client/http/matcher/transaction_matchers.rb', line 14

def transaction_info
    "Request: #{transaction.request.url} using #{transaction.request.request_method}" + "\n" +
    "  sent headers: #{transaction.request.headers}" + "\n" +
    "  sent params: #{transaction.request.url_encoded_params}" + "\n" +
    "Response code: #{transaction.response.code}" + "\n" +
    "  with cookies: #{transaction.response.cookies}" + "\n" +
    "  with html body: #{transaction.response.body}"
end