test/fastly/client_test.rb in fastly-2.5.2 vs test/fastly/client_test.rb in fastly-2.5.3
- old
+ new
@@ -10,11 +10,11 @@
assert_raises(ArgumentError) {
Fastly::Client.new()
}
end
- it 'does not log in if user/pass are not provided' do
+ it 'does not set the user/pass if they are not provided' do
client = Fastly::Client.new(api_key: api_key)
assert_equal api_key, client.api_key
assert_equal nil, client.user
assert_equal nil, client.password
@@ -25,9 +25,16 @@
e = assert_raises(Fastly::Unauthorized) {
Fastly::Client.new(user: user, password: pass)
}
assert_equal "Invalid auth credentials. Check username/password.", e.message
+ end
+
+ it 'surfaces a deprecation message when a username or password is provided' do
+ stub_request(:any, /api.fastly.com/).
+ to_return(body: JSON.generate(i: "dont care"), status: 200)
+
+ assert_output('', /DEPRECATION WARNING:/) { Fastly::Client.new(user: user, password: pass) }
end
it 'initializes an http client' do
client = Fastly::Client.new(api_key: api_key)