Sha256: 0f592f29a250b51c0db8b8d61a210eea4546648d9c5576083e4b8d9b8311025d
Contents?: true
Size: 1.2 KB
Versions: 3
Compression:
Stored size: 1.2 KB
Contents
# frozen_string_literal: true require 'helper' require 'null_client' require 'peddler/vcr_matcher' require 'recorder' class TestPeddlerVCRMatcher < MiniTest::Test include Recorder ::Peddler::VCRMatcher.ignore_seller! def setup VCR.insert_cassette(test_name) end def test_matches_recorded_post_without_body client.run end def test_wont_match_unrecorded_post_without_body client.operation.add(foo: 'bar') assert_raises(VCR::Errors::UnhandledHTTPRequestError) do client.run end end def test_matches_recorded_post_with_body client.body = 'content' client.run end def test_wont_match_unrecorded_post_with_different_query_and_same_body client.operation.add(foo: 'bar') client.body = 'content' assert_raises(VCR::Errors::UnhandledHTTPRequestError) do client.run end end def test_wont_match_unrecorded_post_with_same_query_and_different_body client.body = 'other content' assert_raises(VCR::Errors::UnhandledHTTPRequestError) do client.run end end def client @client ||= begin client = Class.new(Null::Client).new client.configure_with_mock_data! client.operation('Action') client end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
peddler-2.0.4 | test/unit/peddler/test_vcr_matcher.rb |
peddler-2.0.3 | test/unit/peddler/test_vcr_matcher.rb |
peddler-2.0.0 | test/unit/peddler/test_vcr_matcher.rb |