Sha256: 1ecb76c9f0c320c55ce75df7a7a3e3eef42ec37fbc31b87158b90d0be1187571

Contents?: true

Size: 444 Bytes

Versions: 1

Compression:

Stored size: 444 Bytes

Contents

module Danconia
  module TestHelpers
    class << self
      def with_config &block
        old_config = Danconia.config.dup
        Danconia.configure &block
        Danconia.config = old_config
      end

      def with_rates rates
        with_config do |config|
          config.default_exchange = Exchanges::FixedRates.new rates: rates, currencies: config.default_exchange.currencies
          yield
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danconia-0.2.2 lib/danconia/test_helpers.rb