Skip to content

Commit 213d19f

Browse files
vivekmiyanipirj
authored andcommitted
Apply suggestions from code review
1 parent 1134e49 commit 213d19f

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Changelog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
### Development
22
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.0.rc1...main)
33

4+
Enhancements:
5+
6+
* Generators now respects default path configuration option. (@vivekmiyani, #2508)
7+
48
Breaking Changes:
59

610
* Change the order of `after_teardown` from `after` to `around` in system
@@ -73,8 +77,6 @@ Bug Fixes:
7377
`run_in_transaction?` method. (Stan Lo, #2495)
7478
* Prevent keyword arguments being lost when methods are invoked dynamically
7579
in controller specs. (Josh Cheek, #2509, #2514)
76-
* Read configuration options from files to respect spec path setting.
77-
(@vivekmiyani, #2508)
7880

7981
### 5.0.1 / 2021-03-18
8082
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.0.0...v5.0.1)

lib/generators/rspec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def self.source_root(path = nil)
2020
end
2121
end
2222

23-
# Read configuration options from files to respect `--default-path`
23+
# @private
24+
# Load configuration from RSpec to ensure `--default-path` is set
2425
def self.configuration
2526
@configuration ||= begin
2627
configuration = RSpec.configuration

lib/generators/rspec/install/install_generator.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ def generate_rspec_init(tmpdir)
4444
replace_generator_command(spec_helper_path)
4545
remove_warnings_configuration(spec_helper_path)
4646

47-
dot_rspec_path = File.join(tmpdir, '.rspec')
47+
unless default_path == "spec"
48+
dot_rspec_path = File.join(tmpdir, '.rspec')
4849

49-
append_default_path(dot_rspec_path)
50+
append_default_path(dot_rspec_path)
51+
end
5052
end
5153

5254
def replace_generator_command(spec_helper_path)

0 commit comments

Comments
 (0)