<commit_before>require 'rails_helper'

module PaymentProcessor
  module Clients
    module Braintree
      describe SubscriptionPlanSelector do
        subject { described_class }

        describe '.for_currency' do
          context 'unmatched currency' do
            it 'raises' do
              expect{
                subject.for_currency('VVZ')
              }.to raise_error(Exceptions::InvalidCurrency, 'No merchant account is associated with this currency: VVZ')
            end
          end

          context 'matched currency' do
            it 'returns merchant account ID' do
              expect( subject.for_currency('EUR') ).to eq('EUR')
            end
          end
        end
      end
    end
  end
end
<commit_msg>Stub subscription plans for spec<commit_after>require 'rails_helper'

module PaymentProcessor
  module Clients
    module Braintree
      describe SubscriptionPlanSelector do
        before do
          stub_const("PaymentProcessor::Clients::Braintree::SubscriptionPlanSelector::SUBSCRIPTION_PLANS", { EUR: 'EUR' })
        end

        subject { described_class }

        describe '.for_currency' do
          context 'unmatched currency' do
            it 'raises' do
              expect{
                subject.for_currency('VVZ')
              }.to raise_error(Exceptions::InvalidCurrency, 'No merchant account is associated with this currency: VVZ')
            end
          end

          context 'matched currency' do
            it 'returns merchant account ID' do
              expect( subject.for_currency('EUR') ).to eq('EUR')
            end
          end
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06662628709872805, 'fraction_numerical': 0.0, 'mean_word_length': 1.9187279151943464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7490719', 'n_tokens_mistral': 423, 'n_tokens_neox': 411, 'n_words': 128}