Skip to content

Commit 91378c1

Browse files
authored
Merge pull request #505 from intercom/ga/add-support-for-unstable-version
Accept 'Unstable' API Version
2 parents b193d55 + 51ad116 commit 91378c1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/intercom/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def validate_credentials!
136136

137137
def validate_api_version!
138138
error = MisconfiguredClientError.new("api_version must be either nil or a valid API version")
139-
fail error if (@api_version && Gem::Version.new(@api_version) < Gem::Version.new('1.0'))
139+
fail error if (@api_version && @api_version != 'Unstable' && Gem::Version.new(@api_version) < Gem::Version.new('1.0'))
140140
end
141141

142142
def execute_request(request)

spec/unit/intercom/client_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ module Intercom
6666
assert_nil(Client.new(app_id: app_id, api_key: api_key, api_version: nil).api_version)
6767
end
6868

69+
it 'allows api version to be Unstable' do
70+
Client.new(app_id: app_id, api_key: api_key, api_version: 'Unstable').api_version.must_equal('Unstable')
71+
end
72+
6973
it 'raises on invalid api version' do
7074
proc { Client.new(app_id: app_id, api_key: api_key, api_version: '0.2') }.must_raise MisconfiguredClientError
7175
end

0 commit comments

Comments
 (0)