diff --git a/.gitignore b/.gitignore index dcaeedf..ef98eb5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ pkg Gemfile.lock ## PROJECT::SPECIFIC +spec/support/api_keys.rb ## YARD doc diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 086b9c4..bb9b909 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,22 @@ require 'fakeweb' require File.dirname(__FILE__) + '/../lib/govkit' +# Set to true to run tests against the live URLs, and add the following to +# spec/support/api_keys.rb: +# +# unless FakeWeb.allow_net_connect? +# GovKit.configure do |config| +# config.sunlight_apikey = 'YOUR_SUNLIGHT_API_KEY' +# config.votesmart_apikey = 'YOUR_VOTESMART_API_KEY' +# config.ftm_apikey = 'YOUR_FTM_API_KEY' +# end +# end +FakeWeb.allow_net_connect = false + +# Requires supporting ruby files with custom matchers and macros, etc, +# in spec/support/ and its subdirectories. +Dir[File.join(File.dirname(__FILE__), 'support', '**', '*.rb')].each {|f| require f} + # prevent the use of `` in tests RSpec.configure do |c| end @@ -25,13 +41,4 @@ def rp(*args) end end -# Set to true to run tests against the live URLs -FakeWeb.allow_net_connect = false - FIXTURES_DIR = File.join(File.dirname(__FILE__), 'fixtures') - -GovKit.configure do |config| - config.openstates_apikey = 'YOUR_OPENSTATES_API_KEY' - config.votesmart_apikey = 'YOUR_VOTESMART_API_KEY' - config.ftm_apikey = 'YOUR_FTM_API_KEY' -end