diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 9ce999c6..cf3650ae 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -5,16 +5,17 @@ jobs: name: 'Test (Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.rails }}, DB: ${{ matrix.db }})' runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - ruby: ['3.3', '3.2', '3.1', '3.0'] - rails: ['7.1', '7.0', '6.1'] + ruby: ['4.0', '3.4', '3.3', '3.2'] + rails: ['8.1', '8.0', '7.2'] db: [mysql, postgres, sqlite] env: BUNDLE_GEMFILE: ${{ github.workspace }}/spec/support/gemfiles/Gemfile.rails-${{ matrix.rails }}.x DB: ${{ matrix.db }} services: mysql: - image: mysql:5.7 + image: mysql:8.0 env: MYSQL_DATABASE: double_entry_test MYSQL_USER: mysql diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e60e3e..29d88bfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- Run the test suite against Rails 8.1, 8.0, 7.2, and Ruby 4.0, 3.4, 3.3, 3.2 ([#225]). + [Unreleased]: https://github.com/envato/double_entry/compare/v2.0.1...HEAD +[#225]: https://github.com/envato/double_entry/pull/225 ## [2.0.1] - 2023-11-01 diff --git a/README.md b/README.md index c845bec3..980cf34d 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,15 @@ DoubleEntry uses the [Money gem](https://github.com/RubyMoney/money) to encapsul DoubleEntry is tested against: Ruby + * 4.0.x + * 3.4.x * 3.3.x * 3.2.x - * 3.1.x - * 3.0.x Rails - * 7.1.x - * 7.0.x - * 6.1.x + * 8.1.x + * 8.0.x + * 7.2.x Databases * MySQL diff --git a/script/jack_hammer b/script/jack_hammer index d2af4d35..503c41d3 100755 --- a/script/jack_hammer +++ b/script/jack_hammer @@ -40,6 +40,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'double_entry' require 'double_entry/line' +Money.default_currency = Money::Currency.new('USD') + def parse_options $account_count = 5 $process_count = 20 diff --git a/spec/double_entry/validation/line_check_spec.rb b/spec/double_entry/validation/line_check_spec.rb index 1c26f882..fb8ca3b8 100644 --- a/spec/double_entry/validation/line_check_spec.rb +++ b/spec/double_entry/validation/line_check_spec.rb @@ -76,7 +76,7 @@ module Validation its(:errors_found) { should be true } its(:log) { should include <<~LOG } - Error on account \#{Account account: savings scope: currency: USD}: 100.01 (cached balance) != 100.00 (running balance) + Error on account \#{Account account: savings scope: currency: }: 100.01 (cached balance) != 100.00 (running balance) LOG it 'should correct the account balance' do diff --git a/spec/support/gemfiles/Gemfile.rails-7.1.x b/spec/support/gemfiles/Gemfile.rails-7.1.x deleted file mode 100644 index 7617a0a9..00000000 --- a/spec/support/gemfiles/Gemfile.rails-7.1.x +++ /dev/null @@ -1,10 +0,0 @@ -source 'https://rubygems.org' - -gemspec path: '../../../' - -gem 'activerecord', '~> 7.1.0' - -# Rails imposed database gem constraints -gem 'mysql2', '~> 0.5' # https://github.com/rails/rails/blob/7-1-stable/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 -gem 'pg', '~> 1.1' # https://github.com/rails/rails/blob/7-1-stable/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3 -gem 'sqlite3', '~> 1.4' # https://github.com/rails/rails/blob/7-1-stable/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14 diff --git a/spec/support/gemfiles/Gemfile.rails-7.0.x b/spec/support/gemfiles/Gemfile.rails-7.2.x similarity index 60% rename from spec/support/gemfiles/Gemfile.rails-7.0.x rename to spec/support/gemfiles/Gemfile.rails-7.2.x index 5fc29c6e..ca047d19 100644 --- a/spec/support/gemfiles/Gemfile.rails-7.0.x +++ b/spec/support/gemfiles/Gemfile.rails-7.2.x @@ -2,9 +2,9 @@ source 'https://rubygems.org' gemspec path: '../../../' -gem 'activerecord', '~> 7.0.0' +gem 'activerecord', '~> 7.2.0' # Rails imposed database gem constraints -gem 'mysql2', '~> 0.5' # https://github.com/rails/rails/blob/7-0-stable/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 -gem 'pg', '~> 1.1' # https://github.com/rails/rails/blob/7-0-stable/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3 -gem 'sqlite3', '~> 1.4' # https://github.com/rails/rails/blob/7-0-stable/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14 +gem 'mysql2', '~> 0.5' # https://github.com/rails/rails/blob/7-2-stable/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 +gem 'pg', '~> 1.1' # https://github.com/rails/rails/blob/7-2-stable/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3 +gem 'sqlite3', '~> 1.4' # https://github.com/rails/rails/blob/7-2-stable/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14 diff --git a/spec/support/gemfiles/Gemfile.rails-8.0.x b/spec/support/gemfiles/Gemfile.rails-8.0.x new file mode 100644 index 00000000..5ab71a79 --- /dev/null +++ b/spec/support/gemfiles/Gemfile.rails-8.0.x @@ -0,0 +1,10 @@ +source 'https://rubygems.org' + +gemspec path: '../../../' + +gem 'activerecord', '~> 8.0.0' + +# Rails imposed database gem constraints +gem 'mysql2', '~> 0.5' # https://github.com/rails/rails/blob/8-0-stable/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 +gem 'pg', '~> 1.1' # https://github.com/rails/rails/blob/8-0-stable/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3 +gem 'sqlite3', '>= 2.1' # https://github.com/rails/rails/blob/8-0-stable/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14 diff --git a/spec/support/gemfiles/Gemfile.rails-6.1.x b/spec/support/gemfiles/Gemfile.rails-8.1.x similarity index 60% rename from spec/support/gemfiles/Gemfile.rails-6.1.x rename to spec/support/gemfiles/Gemfile.rails-8.1.x index f3c68700..d29a9db7 100644 --- a/spec/support/gemfiles/Gemfile.rails-6.1.x +++ b/spec/support/gemfiles/Gemfile.rails-8.1.x @@ -2,9 +2,9 @@ source 'https://rubygems.org' gemspec path: '../../../' -gem 'activerecord', '~> 6.1.0' +gem 'activerecord', '~> 8.1.0' # Rails imposed database gem constraints -gem 'mysql2', '~> 0.5' # https://github.com/rails/rails/blob/6-1-stable/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 -gem 'pg', '~> 1.1' # https://github.com/rails/rails/blob/6-1-stable/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3 -gem 'sqlite3', '~> 1.4' # https://github.com/rails/rails/blob/6-1-stable/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14 +gem 'mysql2', '~> 0.5' # https://github.com/rails/rails/blob/8-1-stable/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6 +gem 'pg', '~> 1.1' # https://github.com/rails/rails/blob/8-1-stable/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L3 +gem 'sqlite3', '>= 2.1' # https://github.com/rails/rails/blob/8-1-stable/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14 diff --git a/spec/support/money.rb b/spec/support/money.rb index 452a5f50..384ed4dc 100644 --- a/spec/support/money.rb +++ b/spec/support/money.rb @@ -1 +1,2 @@ Money.locale_backend = :i18n +Money.default_currency = Money::Currency.new('USD')