Skip to content

Commit ca9fdcb

Browse files
author
Ron Dahlgren
committed
Broaden test to check for exclusion of the API key
1 parent 9813628 commit ca9fdcb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

spec/serpapi/client/client_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,13 @@
9898

9999
it 'should not expose api_key via inspect' do
100100
inspect_str = client.inspect
101-
expect(inspect_str).to include('#<SerpApi::Client @engine=google @timeout=')
102101
expect(inspect_str).to_not include(ENV['SERPAPI_KEY'])
103102
end
104103

105-
it 'should gracefully handle api_key values shorter than 5 characters' do
106-
short_key_client = SerpApi::Client.new(engine: 'google', api_key: 'abcd', timeout: 10)
104+
it 'should gracefully handle api_key values shorter than 8 characters' do
105+
short_key_client = SerpApi::Client.new(engine: 'google', api_key: 'abcdef', timeout: 10)
107106
inspect_str = short_key_client.inspect
108-
expect(inspect_str).to include('#<SerpApi::Client @engine=google @timeout=')
109-
expect(inspect_str).to_not include('abcd')
107+
expect(inspect_str).to_not include('abcdef')
110108

111109
end
112110
end

0 commit comments

Comments
 (0)