stripe-ruby/Rakefile
Brandur 00180c5f35 Power test suite with stripe-mock
Moves away from Committee and towards stripe-mock, an external
self-contained executable API stub server based on OpenAPI [1]. The
motivation here is that instead of making stripe-ruby a special
snowflake, we can use a single well-tested and feature-rich mock
implementation to drive every API's test suite.

[1] https://github.com/stripe/stripe-mock
2017-07-31 13:25:48 -07:00

32 lines
627 B
Ruby

require 'rake/testtask'
task :default => [:test]
Rake::TestTask.new do |t|
t.pattern = './test/**/*_test.rb'
end
desc "Update bundled certs"
task :update_certs do
require "faraday"
fetch_file "https://curl.haxx.se/ca/cacert.pem",
File.expand_path("../lib/data/ca-certificates.crt", __FILE__)
end
#
# helpers
#
def fetch_file(url, dest)
File.open(dest, 'w') do |file|
resp = Faraday.get(url)
unless resp.status == 200
abort("bad response when fetching: #{url}\n" \
"Status #{resp.status}: #{resp.body}")
end
file.write(resp.body)
puts "Successfully fetched: #{url}"
end
end