@@ -24,7 +24,7 @@ closure_tree has some great features:
2424 * 2 SQL INSERTs on node creation
2525 * 3 SQL INSERT/UPDATEs on node reparenting
2626* __ Support for [ concurrency] ( #concurrency ) __ (using [ with_advisory_lock] ( https://github.com/ClosureTree/with_advisory_lock ) )
27- * __ Tested against ActiveRecord 7.1 + with Ruby 3.3+__
27+ * __ Tested against ActiveRecord 7.2 + with Ruby 3.3+__
2828* Support for reparenting children (and all their descendants)
2929* Support for [ single-table inheritance (STI)] ( #sti ) within the hierarchy
3030* ``` find_or_create_by_path ``` for [ building out heterogeneous hierarchies quickly and conveniently] ( #find_or_create_by_path )
@@ -52,7 +52,7 @@ for a description of different tree storage algorithms.
5252
5353## Installation
5454
55- Note that closure_tree only supports ActiveRecord 7.1 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.
55+ Note that closure_tree only supports ActiveRecord 7.2 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.
5656
57571 . Add ` gem 'closure_tree' ` to your Gemfile
5858
@@ -629,57 +629,37 @@ Upgrade to MySQL 5.7.12 or later if you see [this issue](https://github.com/Clos
629629
630630## Testing with Closure Tree
631631
632- Closure tree comes with some RSpec2/3 matchers which you may use for your tests:
632+ Closure tree comes with test matchers which you may use in your tests:
633633
634634```ruby
635- require ' spec_helper '
635+ require ' test_helper '
636636require ' closure_tree/ test / matcher'
637637
638- describe Category do
639- # Should syntax
640- it { should be_a_closure_tree }
641- # Expect syntax
642- it { is_expected.to be_a_closure_tree }
643- end
644-
645- describe Label do
646- # Should syntax
647- it { should be_a_closure_tree.ordered }
648- # Expect syntax
649- it { is_expected.to be_a_closure_tree.ordered }
650- end
651-
652- describe TodoList::Item do
653- # Should syntax
654- it { should be_a_closure_tree.ordered(:priority_order) }
655- # Expect syntax
656- it { is_expected.to be_a_closure_tree.ordered(:priority_order) }
638+ class CategoryTest < ActiveSupport::TestCase
639+ test "should be a closure tree" do
640+ assert Category.new.is_a?(ClosureTree::Model)
641+ end
657642end
658-
659643```
660644
661645## Testing
662646
663647Closure tree is [tested under every valid combination](https://github.com/ClosureTree/closure_tree/blob/master/.github/workflows/ci.yml) of
664648
665649* Ruby 3.3+
666- * ActiveRecord 7.1 +
650+ * ActiveRecord 7.2 +
667651* PostgreSQL, MySQL, and SQLite. Concurrency tests are only run with MySQL and PostgreSQL.
668652
669653```shell
670654$ bundle
671- $ appraisal bundle # this will install the matrix of dependencies
672- $ appraisal rake # this will run the tests in all combinations
673- $ appraisal activerecord-7.0 rake # this will run the tests in AR 7.0 only
674- $ appraisal activerecord-7.0 rake spec # this will run rspec in AR 7.0 only
675- $ appraisal activerecord-7.0 rake test # this will run minitest in AR 7.0 only
655+ $ rake test # this will run the tests
676656```
677657
678658By default the test are run with sqlite3 only.
679659You run test with other databases by passing the database url as environment variable:
680660
681661```shell
682- $ DATABASE_URL=postgres://localhost/my_database appraisal activerecord-7.0 rake test
662+ $ DATABASE_URL=postgres://localhost/my_database rake test
683663```
684664
685665## Change log
0 commit comments