test/helper.rb in fastly-1.5.0 vs test/helper.rb in fastly-1.6.0
- old
+ new
@@ -12,10 +12,18 @@
[:url, :port].each do |what|
key = "FASTLY_TEST_BASE_#{what.to_s.upcase}"
opts["base_#{what}".to_sym] = ENV[key] if ENV.key?(key)
end
- required = :full == mode ? [:user, :password] : [:api_key]
+ required = case mode
+ when :full
+ [:user, :password]
+ when :both
+ [:user, :password, :api_key]
+ else
+ [:api_key]
+ end
+
required.each do |what|
key = "FASTLY_TEST_#{what.to_s.upcase}"
unless ENV.key?(key)
warn "You haven't set the environment variable #{key}"
exit(-1)