spec/spec_helper.rb in s3repo-0.3.4 vs spec/spec_helper.rb in s3repo-1.0.0
- old
+ new
@@ -1,10 +1,33 @@
-require 'simplecov'
-require 'coveralls'
-
-SimpleCov.formatter = Coveralls::SimpleCov::Formatter
-SimpleCov.start do
- add_filter '/spec/'
+if ENV['CI'] == 'true'
+ require 'simplecov'
+ require 'codecov'
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
+ SimpleCov.start do
+ add_filter '/spec/'
+ end
end
require 'rspec'
require 's3repo'
+
+require 'vcr'
+VCR.configure do |c|
+ c.cassette_library_dir = 'spec/fixtures/cassettes'
+ c.hook_into :webmock
+ c.configure_rspec_metadata!
+ c.before_record do |i|
+ i.request.headers.delete 'Authorization'
+ end
+end
+
+require 'climate_control'
+AUTH_OPTS = {
+ S3_BUCKET: 'amylum',
+ AWS_REGION: 'us-east-1',
+ AWS_SECRET_ACCESS_KEY: 'accesskey',
+ AWS_ACCESS_KEY_ID: 'sekritkey'
+}.freeze
+def with_auth(&block)
+ opts = AUTH_OPTS.dup.map { |k, v| [k, ENV.fetch("REAL_#{k}", v)] }
+ ClimateControl.modify(Hash[opts], &block)
+end