diff --git a/.gitignore b/.gitignore index 86d8b76..0171113 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ dist/* *.log browserstack.err + +# Local Bundler state. .bundle/config can carry settings that weaken install-time +# integrity checks (e.g. disable_checksum_validation), so it must never be committed. +.bundle/ +vendor/bundle/ diff --git a/Gemfile b/Gemfile index 68f3992..a39a2bb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,6 @@ -source "http://rubygems.org" +source "https://rubygems.org" gem "minitest" gem "rake" -gem "json" +# "json" is intentionally NOT listed: lib/ uses the `json` default gem that ships +# with Ruby, and the gemspec declares no dependency on it, so a third-party json +# build is a redundant build-time dependency (and a native extension) to pull in. diff --git a/Gemfile.lock b/Gemfile.lock index 352171b..d7e7839 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,17 +1,28 @@ GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: - json (1.8.3) - minitest (5.8.4) - rake (12.3.3) + drb (2.2.3) + minitest (6.0.6) + drb (~> 2.0) + prism (~> 1.5) + prism (1.9.0) + rake (13.4.2) PLATFORMS + aarch64-linux + arm64-darwin-24 ruby + x86_64-linux DEPENDENCIES - json minitest rake +CHECKSUMS + drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373 + minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1 + prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 + BUNDLED WITH - 1.11.2 + 2.7.1 diff --git a/test/browserstack-local-test.rb b/test/browserstack-local-test.rb index 2c6218b..51a55dd 100644 --- a/test/browserstack-local-test.rb +++ b/test/browserstack-local-test.rb @@ -8,17 +8,28 @@ def setup @bs_local = BrowserStack::Local.new end + # The tests below actually start the BrowserStackLocal binary and open a + # tunnel, so they need a valid BROWSERSTACK_ACCESS_KEY and network access. + # Skip them (instead of erroring) when no key is available so the rest of + # the suite stays green in credential-less environments such as CI. + def skip_without_credentials + skip 'requires BROWSERSTACK_ACCESS_KEY (live integration test)' if ENV['BROWSERSTACK_ACCESS_KEY'].to_s.empty? + end + def test_check_pid + skip_without_credentials @bs_local.start refute_nil @bs_local.pid, 0 end def test_is_running + skip_without_credentials @bs_local.start assert_equal true, @bs_local.isRunning end def test_multiple_binary + skip_without_credentials @bs_local.start bs_local_2 = BrowserStack::Local.new second_log_file = File.join(Dir.pwd, 'local2.log')