Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make support/rspec.rb closer to RSpec default #20

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

timriley
Copy link
Member

@timriley timriley commented Nov 4, 2023

Having this file be completely devoid of comments makes it harder for people to understand, particularly when many of the RSpec configuration options have significant impact on the features available when using the tool.

rspec --init, on the other hand, creates a spec_helper.rb with lots of comments. Probably a little too much.

As a compromise, copy the most helpful aspects of the comments from the default spec_helper.rb to our support/rspec.rb, condensing the text wherever possible.

In addition, enable the one feature from the rspec --init output that was missing in our file: config.example_status_persistence_file_path. This is a very helpful feature and it would be good for our users to have access to this by default. Leave this configured with the default "spec/examples.txt", and in our hanami install hook, update the .gitignore file to ignore it.

Having this file be completely devoid of comments makes it harder for people to understand, particularly when many of the RSpec configuration options have significant impact on the features available when using the tool.

`rspec —init`, on the other hand, creates a spec_helper.rb with *lots* of comments. Probably a little too much.

As a compromise, copy the most helpful aspects of the comments from the default spec_helper.rb to our support/rspec.rb, condensing the text wherever possible.

In addition, enable the one feature from the `rspec —init` output that was missing in our file: `config.example_status_persistence_file_path`. This is a very helpful feature and it would be good for our users to have access to this by default. Leave this configured with the default “spec/examples.txt”, and in our `hanami install` hook, update the `.gitignore` file to ignore it.
@timriley timriley requested a review from jodosha November 4, 2023 10:19
@timriley timriley self-assigned this Nov 4, 2023
@timriley timriley added this to the v2.1.0 milestone Nov 4, 2023
Even when running tests for the getting started guide, this was resulting in some warnings being output (for e.g. the debug gem). To reduce noisy and give people greater confidence with their first tests, disable this by default.

Leave a comment recommending that the user turn it on if they choose.
Copy link
Member

@jodosha jodosha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timriley 👍

“Hanami app” was too generic. By using “Rack::Test” here, we make it clearer that this shared context is specific for Rack::Test specs only.
@timriley timriley merged commit e528971 into main Nov 6, 2023
6 checks passed
@timriley timriley deleted the include-explanatory-comments-in-support-rspec branch November 6, 2023 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants