From d53003ed00ed48b45a91dce4b2f35b7ddb49067c Mon Sep 17 00:00:00 2001 From: Ian Katz Date: Sun, 29 Nov 2020 21:07:22 -0500 Subject: [PATCH] expose DESIRED_ARDUINO_CLI_VERSION --- CHANGELOG.md | 1 + lib/arduino_ci/arduino_installation.rb | 4 ++-- spec/arduino_installation_spec.rb | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 563171de..51de3c44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Symlink tests for `Host` - Add documentation on how to use Arduino CI with GitHub Actions - Allow tests to run on GitHub without external set up, via GitHub Actions (Windows, Linux, MacOS) +- Exposed desired CLI backend version as `ArduinoInstallation::DESIRED_ARDUINO_CLI_VERSION` ### Changed - Arduino backend is now `arduino-cli` version `0.13.0` diff --git a/lib/arduino_ci/arduino_installation.rb b/lib/arduino_ci/arduino_installation.rb index 01d45ab2..b422fac0 100644 --- a/lib/arduino_ci/arduino_installation.rb +++ b/lib/arduino_ci/arduino_installation.rb @@ -5,8 +5,6 @@ require "arduino_ci/arduino_downloader_linux" require "arduino_ci/arduino_downloader_windows" if ArduinoCI::Host.os == :windows -DESIRED_ARDUINO_CLI_VERSION = "0.13.0".freeze - module ArduinoCI class ArduinoInstallationError < StandardError; end @@ -14,6 +12,8 @@ class ArduinoInstallationError < StandardError; end # Manage the OS-specific install location of Arduino class ArduinoInstallation + DESIRED_ARDUINO_CLI_VERSION = "0.13.0".freeze + class << self # attempt to find a workable Arduino executable across platforms diff --git a/spec/arduino_installation_spec.rb b/spec/arduino_installation_spec.rb index f11bdaab..e53ea523 100644 --- a/spec/arduino_installation_spec.rb +++ b/spec/arduino_installation_spec.rb @@ -3,6 +3,12 @@ RSpec.describe ArduinoCI::ArduinoInstallation do next if skip_ruby_tests + context "constants" do + it "Exposes desired backend version" do + expect(ArduinoCI::ArduinoInstallation::DESIRED_ARDUINO_CLI_VERSION).to eq("0.13.0") + end + end + context "autolocate" do it "doesn't fail" do ArduinoCI::ArduinoInstallation.autolocate