Sha256: 97d0d30af5f9330b58afa96b87dec50e2800281839f87fa9563fb865ba725daa

Contents?: true

Size: 396 Bytes

Versions: 10

Compression:

Stored size: 396 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
          yield
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
danconia-0.4.0 lib/danconia/test_helpers.rb
danconia-0.3.1 lib/danconia/test_helpers.rb
danconia-0.3.0 lib/danconia/test_helpers.rb
danconia-0.2.9 lib/danconia/test_helpers.rb
danconia-0.2.8 lib/danconia/test_helpers.rb
danconia-0.2.7 lib/danconia/test_helpers.rb
danconia-0.2.6 lib/danconia/test_helpers.rb
danconia-0.2.5 lib/danconia/test_helpers.rb
danconia-0.2.4 lib/danconia/test_helpers.rb
danconia-0.2.3 lib/danconia/test_helpers.rb