Skip to content

Commit 48a4d11

Browse files
committed
Merge pull request #119 from rainforestapp/hotfix/remove-static-browser-list
Remove browser exception and allow the API to validate instead
2 parents 01e30ba + 878f2b5 commit 48a4d11

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

lib/rainforest/cli/options.rb

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,6 @@ class OptionParser
88
:import_file_name, :import_name, :custom_url, :description, :folder,
99
:debug, :file_name, :test_folder, :embed_tests, :app_source_url, :crowd
1010

11-
# Note, not all of these may be available to your account
12-
# also, we may remove this in the future.
13-
VALID_BROWSERS = %w{
14-
android_phone_landscape
15-
android_phone_portrait
16-
android_tablet_landscape
17-
android_tablet_portrait
18-
chrome
19-
chrome_1440_900
20-
chrome_adblock
21-
chrome_ghostery
22-
chrome_guru
23-
chrome_ublock
24-
firefox
25-
firefox_1440_900
26-
ie10
27-
ie10_1440_900
28-
ie11
29-
ie11_1440_900
30-
ie8
31-
ie8_1440_900
32-
ie9
33-
ie9_1440_900
34-
ios_iphone4s
35-
office2010
36-
office2013
37-
osx_chrome
38-
osx_firefox
39-
safari
40-
ubuntu_chrome
41-
ubuntu_firefox
42-
iphone_6s_v9_0
43-
}.freeze
4411
TOKEN_NOT_REQUIRED = %w{new validate}.freeze
4512

4613
def initialize(args)
@@ -183,10 +150,6 @@ def validate!
183150
end
184151
end
185152

186-
if browsers
187-
raise BrowserException, browsers unless (browsers - VALID_BROWSERS).empty?
188-
end
189-
190153
if custom_url && site_id.nil?
191154
raise ValidationError, 'The site-id and custom-url options are both required.'
192155
end
@@ -208,12 +171,5 @@ def validate!
208171

209172
class ValidationError < RuntimeError
210173
end
211-
212-
class BrowserException < ValidationError
213-
def initialize browsers
214-
invalid_browsers = browsers - OptionParser::VALID_BROWSERS
215-
super "#{invalid_browsers.join(', ')} is not valid. Valid browsers: #{OptionParser::VALID_BROWSERS.join(', ')}"
216-
end
217-
end
218174
end
219175
end

spec/options_spec.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,5 @@ def raises_a_validation_exception
166166
it { raises_a_validation_exception }
167167
end
168168
end
169-
170-
context 'with invalid browsers' do
171-
let(:args) { %w{run --browsers lulbrowser --token foo} }
172-
173-
it 'raises an exception' do
174-
expect { subject.validate! }.to raise_error(RainforestCli::OptionParser::BrowserException)
175-
end
176-
end
177169
end
178170
end

0 commit comments

Comments
 (0)