Sha256: 51829aef8d3bac28766511c13748ebb958c36941452f14fcaddf40f59bed5b17

Contents?: true

Size: 889 Bytes

Versions: 6

Compression:

Stored size: 889 Bytes

Contents

module PstnHelpers
  include Torasup::Test::Helpers

  private

  def yaml_file(filename)
    File.join(File.dirname(__FILE__), "../../spec/support/#{filename}")
  end

  def clear_pstn
    Torasup.configure do |config|
      config.custom_pstn_data_file = nil
    end
  end

  def clear_registered_operators
    Torasup.configure do |config|
      config.registered_operators = {}
    end
  end

  def configure_registered_operators(country_id, *operators)
    Torasup.configure do |config|
      config.register_operators(country_id, *operators)
    end
  end

  def configure_with_custom_data
    Torasup.configure do |config|
      config.custom_pstn_data_file = File.join(File.dirname(__FILE__), "../support", "/custom_pstn.yaml")
    end
  end
end

RSpec.configure do |config|
  config.include(PstnHelpers)

  config.before do
    clear_pstn
    clear_registered_operators
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
torasup-0.0.15 spec/support/pstn_helpers.rb
torasup-0.0.14 spec/support/pstn_helpers.rb
torasup-0.0.13 spec/support/pstn_helpers.rb
torasup-0.0.12 spec/support/pstn_helpers.rb
torasup-0.0.11 spec/support/pstn_helpers.rb
torasup-0.0.10 spec/support/pstn_helpers.rb