From b0cf7c032bb2d336a1da4a1f15ecf20ea971ca67 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Fri, 8 Mar 2024 14:42:23 +0100 Subject: [PATCH 1/2] Test against Ruby 3.3 Ruby 3.3 is the stable Ruby version at the moment. Also updates the checkout action to the latest available to prevent a deprecation warning related to Node 16 based actions. --- .github/workflows/ruby.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index b79489985..bfa706c66 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,12 +19,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2'] + ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] mongodb-version: ['4.4'] sqlite-version: ['3.0'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): From 9245799a8342a4bfbd78c32769460c2d1e75867a Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Fri, 8 Mar 2024 14:51:18 +0100 Subject: [PATCH 2/2] Fix specs deprecation errors Fix the following deprecation issues in specs: - Default localization behaviour - Default rounding mode - `symbol_position` option --- spec/configuration_spec.rb | 2 +- spec/dummy/config/initializers/money.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index d3f896924..7fb36f0b8 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -76,7 +76,7 @@ value = Money.new(-12345600, "EUR") symbol = Money::Currency.find(:eur).symbol - MoneyRails.default_format = {symbol_position: :after} + MoneyRails.default_format = { format: '%n%u' } expect(value.format).to match(/#{symbol}\z/) # Override with "classic" format options for backward compatibility diff --git a/spec/dummy/config/initializers/money.rb b/spec/dummy/config/initializers/money.rb index 34c92ff5e..c9b333933 100644 --- a/spec/dummy/config/initializers/money.rb +++ b/spec/dummy/config/initializers/money.rb @@ -1,6 +1,8 @@ # encoding : utf-8 MoneyRails.configure do |config| + Money.locale_backend = :i18n + Money.rounding_mode = BigDecimal::ROUND_HALF_UP # To set the default currency #