Sha256: 8701331cfcc1ab4f82910da061b2f125a7c58ce39286c7c0ad14e720150dd61f

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 KB

Contents

require 'rubygems'
require 'bundler/setup'
require 'cgi'
require 'vcr'

$:.unshift(File.dirname(__FILE__) + '/lib')
require 'dnsimple'

config = YAML.load_file(File.expand_path(ENV['DNSIMPLE_TEST_CONFIG'] || '~/.dnsimple.test'))

DNSimple::Client.base_uri   = config['site']      if config['site']     # Example: https://test.dnsimple.com/
DNSimple::Client.base_uri   = config['base_uri']  if config['base_uri'] # Example: https://test.dnsimple.com/
DNSimple::Client.username   = config['username']                        # Example: testusername@example.com
DNSimple::Client.password   = config['password']                        # Example: testpassword
DNSimple::Client.api_token  = config['api_token']                       # Example: 1234567890

VCR.configure do |c|
  c.cassette_library_dir = 'fixtures/vcr_cassettes'
  c.hook_into :fakeweb
  c.filter_sensitive_data("<USERNAME>") { CGI::escape(DNSimple::Client.username) }
  c.filter_sensitive_data("<PASSWORD>") { CGI::escape(DNSimple::Client.password) }
end

RSpec.configure do |c|
  c.mock_framework = :mocha
  c.extend VCR::RSpec::Macros

  # Silent the puts call in the commands
  c.before do
    @_stdout = $stdout
    $stdout = StringIO.new
  end
  c.after do
    $stdout = @_stdout
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dnsimple-ruby-1.4.1 spec/spec_helper.rb
dnsimple-ruby-1.4.0 spec/spec_helper.rb