From f4b3992f9f37ea7be8047ffd9d30b5e1dad33939 Mon Sep 17 00:00:00 2001 From: rusikf Date: Wed, 19 Aug 2015 21:55:33 +0300 Subject: [PATCH] check for nil values on client_secrets specs --- spec/google/api_client/client_secrets_spec.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/spec/google/api_client/client_secrets_spec.rb b/spec/google/api_client/client_secrets_spec.rb index ead9bf7e9..df32133ae 100644 --- a/spec/google/api_client/client_secrets_spec.rb +++ b/spec/google/api_client/client_secrets_spec.rb @@ -48,6 +48,21 @@ RSpec.describe Google::APIClient::ClientSecrets do expect(hash["installed"]["client_secret"]).to be == 'i8YaXdGgiQ4_KrTVNGsB7QP1' end + it 'should remove empty value' do + expect(hash["installed"]["redirect_uris"]).to be nil + end + + it 'should remove nil values' do + expect(hash["installed"]["issued_at"]).to be nil + end end end -end \ No newline at end of file + + context 'with folder wihout client_secrets.json' do + it "should raise exception" do + folder = File.join(FIXTURES_PATH) + expect { Google::APIClient::ClientSecrets.load(folder) }.to raise_exception(ArgumentError) + end + end + +end