Sha256: 11dd9ef36e8f2e16c72ae0fc8d39b634b335b2f9758d55087f462543a3682201
Contents?: true
Size: 800 Bytes
Versions: 66
Compression:
Stored size: 800 Bytes
Contents
module RSpec module ProtocolHelper SUPPORTED_PROTOCOLS = { json: 'JSON', msgpack: 'MsgPack' } PROTOCOLS = if ENV['PROTOCOL'] protocol = ENV['PROTOCOL'].downcase.to_sym { protocol => SUPPORTED_PROTOCOLS[protocol] } else SUPPORTED_PROTOCOLS end def vary_by_protocol(&block) RSpec::ProtocolHelper::PROTOCOLS.each do |protocol, description| context("using #{description} protocol", protocol: protocol, &block) end end end end RSpec.configure do |config| config.extend RSpec::ProtocolHelper config.before(:context, protocol: :json) do |context| context.class.let(:protocol) { :json } end config.before(:context, protocol: :msgpack) do |context| context.class.let(:protocol) { :msgpack } end end
Version data entries
66 entries across 66 versions & 2 rubygems