Generated `spec_helper.rb` / `.rspec` do not quite work as intended #1280

Closed
myronmarston opened this Issue Feb 1, 2014 · 1 comment

Projects

None yet

1 participant

@myronmarston
Member

The generated spec_helper.rb file includes some settings that are only active if the user is only running one file:

https://github.com/rspec/rspec-core/blob/729f2f79f00f9cbc5a58554d8b7d563e888fc531/lib/rspec/core/project_initializer/spec_helper.rb#L30-L40

However, the generated .rspec file now requires spec_helper very early:

https://github.com/rspec/rspec-core/blob/729f2f79f00f9cbc5a58554d8b7d563e888fc531/lib/rspec/core/project_initializer/dot_rspec#L3

At the time spec_helper.rb is loaded, rspec hasn't resolved files_to_run and it's an empty array so these settings aren't working together as intended.

I think we need to resolve files_to_run before requiring files passed by --require or make it resolve lazily when accessed so that it works in this case.

@myronmarston myronmarston self-assigned this Feb 5, 2014
@myronmarston
Member

Fixed by #1289.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment