rspec_n 1.6.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ea1bbeb02bb4db25b1cf60151cc6d84023734914875d0b4f20d2fa8e9d25bac
4
- data.tar.gz: db723b51e76c3d2d80f6875bd0706fd1dd720e0c067f9b31e1521852e15130e7
3
+ metadata.gz: 6e2a6b63db25d81b062d933b0f9db3ba46e9f858869c3a3d2d3274ab1f8a8666
4
+ data.tar.gz: a8821b81e6d853f588245792739b362ed10ed18bc64b56650e1ec0c923387867
5
5
  SHA512:
6
- metadata.gz: 7dfc98c7a039a9c334f87dba49b80b97167b7b30bfe55a22912a66afcf51fd080f2f8e6582deac86447ce7bfb8a1068288604b66eb1d09e119c4a143ecbd019d
7
- data.tar.gz: c152cc6b58f3c0a9948e5486467eb8eaeb39d4e21307a198897de0480bb97e982fad1ab2faa58a1494185c1f826b6b7ae927cc586a6f60306ef48b7a92f1229d
6
+ metadata.gz: 9877b9317ef9dbda4a6c1c0806660276c6273a079cfe61206194dfc651b8b7dea7b33afc2a773c58fa2df70654b428f6da74c43e34e74b687b8fedc250cd7faa
7
+ data.tar.gz: 57c47323728e63b50c0a3d1530b3e6e3d99c39eb295838871cd57185652a62b017ab88579ddd291d8d38093bd2f46e0c636e3cc4beffb9478b6fa4136e877536
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Issues are tracked at https://github.com/roberts1000/rspec_n/issues. Issues marked as **(Internal)** only affect development.
4
4
 
5
+ ## 2.0.0 (Mar 08, 2024)
6
+
7
+ 1. [#118](../../issues/118): Use `db:schema:load` to prepare databases instead of `db:migrate`.
8
+
5
9
  ## 1.6.0 (Feb 19, 2024)
6
10
 
7
11
  1. [#105](../../issues/105): Use `colorize ~> 1.1.0`. **(Internal)**
data/README.md CHANGED
@@ -8,7 +8,7 @@ rspec_n is a Ruby gem that makes it easy to run a project's RSpec test suite N t
8
8
 
9
9
  rspec_n inspects files in your project and determines the best way to start RSpec. If it can't make an educated guess, it will use `bundle exec rspec` as the base command and add any extra information you've entered on the command line (like the order or paths). The following is a list of project types that rspec_n can identify and the associated commands it will try to execute:
10
10
 
11
- 1. Ruby on Rails Applications: `DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=test bundle exec rake db:drop db:create db:migrate && bundle exec rspec`.
11
+ 1. Ruby on Rails Applications: `DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load && bundle exec rspec`.
12
12
  2. Everything else: `bundle exec rspec`.
13
13
 
14
14
  **Note:** You can override this behavior by using the `-c` option, which lets you specify your own command. See the [Use a Custom Command to Start RSpec](#Use-a-Custom-Command-to-Start-RSpec) section for more info.
@@ -45,6 +45,20 @@ gem 'rspec_n', require: false
45
45
 
46
46
  ## Usage
47
47
 
48
+ ### Considerations
49
+
50
+ #### Ruby on Rails
51
+
52
+ 1. By default, rspec_n will attempt to prepare the test database by executing the following code **before each run**:
53
+
54
+ ```
55
+ DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load rake db:drop db:create db:schema:load
56
+ ```
57
+
58
+ 1. `DISABLE_DATABASE_ENVIRONMENT_CHECK=1` disables a Rails check that can prevent the test database from being dropped.
59
+ 1. Since `db:schema:load` is used to prepare the test database, projects must have a correct `schema.rb` or `structure.sql`.
60
+ 1. By default, rspec_n tries to ensure an empty database **before each run** so it does not load seed files. If your test suite depends on seeded data, or other special setup, you will need to specify the exact command that rspec_n uses to invoke each run. See the [Use a Custom Command to Start RSpec](#Use-a-Custom-Command-to-Start-RSpec) section for more info.
61
+
48
62
  ### Basic Usage
49
63
 
50
64
  The simplest way to run rspec_n is to give it a positive integer which tells it how many times to run RSpec:
@@ -4,6 +4,6 @@ module RspecN
4
4
  DEFAULT_COMMAND = 'bundle exec rspec'.freeze
5
5
  DEFAULT_RSPEC_STARTER_COMMAND = 'bin/start_rspec'.freeze
6
6
  # rubocop:disable Layout/LineLength
7
- DEFAULT_RAILS_COMMAND = 'DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=test bundle exec rake db:drop db:create db:migrate && bundle exec rspec'.freeze
7
+ DEFAULT_RAILS_COMMAND = 'DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load && bundle exec rspec'.freeze
8
8
  # rubocop:enable Layout/LineLength
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module RspecN
2
- VERSION = "1.6.0".freeze
2
+ VERSION = "2.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_n
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - roberts1000
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-20 00:00:00.000000000 Z
11
+ date: 2024-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize