Skip to content

Commit c241690

Browse files
committed
update tests to use a custom path for the CLI"
1 parent dd2f823 commit c241690

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636

3737
- name: run specs
3838
run: |
39+
curl -o- https://raw.githubusercontent.com/bugsnag/bugsnag-cli/main/install.sh | bash
3940
bundle config path vendor/fastlane-bundle
4041
bundle install --gemfile=tools/fastlane-plugin/Gemfile
4142
cd tools/fastlane-plugin

tools/fastlane-plugin/spec/bugsnag_upload_dsym_action_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,18 @@ def run_with args
146146
run_with({dsym_path: FIXTURE_PATH, upload_url: "http://myserver.example.com"})
147147
end
148148
end
149+
150+
it 'accepts a custom bugsnag_cli_path as an option' do
151+
custom_cli_path = File.join(ENV['HOME'], ".local/bugsnag/bin/bugsnag-cli")
152+
expect(Kernel).to receive(:system).with("#{custom_cli_path} upload dsym --project-root #{Dir::pwd} \"#{FIXTURE_PATH}\"").and_return(true)
153+
run_with({dsym_path: FIXTURE_PATH, bugsnag_cli_path: custom_cli_path})
154+
end
155+
156+
it 'accepts a custom bugsnag_cli_path with an API key' do
157+
custom_cli_path = File.join(ENV['HOME'], ".local/bugsnag/bin/bugsnag-cli")
158+
api_key = "123456789012345678901234567890FF"
159+
expect(Kernel).to receive(:system).with("#{custom_cli_path} upload dsym --api-key #{api_key} --project-root #{Dir::pwd} \"#{FIXTURE_PATH}\"").and_return(true)
160+
run_with({dsym_path: FIXTURE_PATH, api_key: api_key, bugsnag_cli_path: custom_cli_path})
161+
end
149162
end
150163
end

0 commit comments

Comments
 (0)