Sha256: 804adbd8031081ae5d103bfa0a3b957129ff4d32f02a92e03e1752a20472b38b
Contents?: true
Size: 1.21 KB
Versions: 1
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true # rubocop:disable Metrics/BlockNesting ::RSpec.configure do |config| # rubocop:disable Metrics/BlockLength config.around(:each, stripe: true) do |example| config.rspeckled_logger.debug("Before Each - Start - #{__FILE__}") if defined?(::VCR) vcr_turned_on = ::VCR.turned_on? ::VCR.turn_off! end if defined?(::WebMock) webmock_net_connect = ::WebMock.net_connect_allowed? ::WebMock.allow_net_connect! end ::StripeMock.start if defined?(::StripeMock) begin ::Stripe::Plan.all(count: 100).each do |plan| plan.delete if plan.id.match(/test/i) || plan.name.match(/test/i) end ::Stripe::Customer.all(count: 100).each(&:delete) ensure ::VCR.turn_on! if defined?(::VCR) && vcr_turned_on ::WebMock.allow_net_connect! if defined?(::WebMock) && webmock_net_connect end config.rspeckled_logger.debug("Before Each - End - #{__FILE__}") example.run config.rspeckled_logger.debug("After Each - Start - #{__FILE__}") ::StripeMock.stop if defined?(::StripeMock) config.rspeckled_logger.debug("After Each - End - #{__FILE__}") end end # rubocop:enable Metrics/BlockNesting
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rspeckled-2.1.1 | lib/rspeckled/plugins/hooks/stripe.rb |