Class: Peddler::VCRMatcher
- Inherits:
-
Object
- Object
- Peddler::VCRMatcher
- Defined in:
- lib/peddler/vcr_matcher.rb
Overview
A custom matcher that can be used to record MWS interactions when integration-testing
Constant Summary collapse
- TRANSIENT_PARAMS =
%w( Signature Timestamp StartDate CreatedAfter QueryStartDateTime ).freeze
- SELLER_PARAMS =
%w( AWSAccessKeyId SellerId ).freeze
Instance Attribute Summary collapse
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
Class Method Summary collapse
Instance Method Summary collapse
- #compare ⇒ Object
-
#initialize(*requests) ⇒ VCRMatcher
constructor
A new instance of VCRMatcher.
Constructor Details
#initialize(*requests) ⇒ VCRMatcher
Returns a new instance of VCRMatcher.
29 30 31 |
# File 'lib/peddler/vcr_matcher.rb', line 29 def initialize(*requests) @requests = requests end |
Instance Attribute Details
#requests ⇒ Object (readonly)
Returns the value of attribute requests.
27 28 29 |
# File 'lib/peddler/vcr_matcher.rb', line 27 def requests @requests end |
Class Method Details
.call(*requests) ⇒ Object
14 15 16 |
# File 'lib/peddler/vcr_matcher.rb', line 14 def call(*requests) new(*requests).compare end |
.ignore_seller! ⇒ Object
22 23 24 |
# File 'lib/peddler/vcr_matcher.rb', line 22 def ignore_seller! ignored_params.concat(SELLER_PARAMS) end |
.ignored_params ⇒ Object
18 19 20 |
# File 'lib/peddler/vcr_matcher.rb', line 18 def ignored_params @ignored_params ||= TRANSIENT_PARAMS.dup end |
Instance Method Details
#compare ⇒ Object
33 34 35 |
# File 'lib/peddler/vcr_matcher.rb', line 33 def compare compare_uris && compare_bodies end |