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

How do we want to test *new* Rails applications? #1240

Open
stevepolitodesign opened this issue Dec 3, 2024 · 4 comments
Open

How do we want to test *new* Rails applications? #1240

stevepolitodesign opened this issue Dec 3, 2024 · 4 comments
Labels
Discussion Needs feedback

Comments

@stevepolitodesign
Copy link
Contributor

In #1156 we opted for RSpec over the default test framework.

I think it's good to challenge this decision from time to time, since the decision wasn't unanimous.

Below are some questions that I think could guide this decision.

  • What gains does RSpec provide in terms of developer experience that the default test framework does not provide?
  • What gains does the default test framework provide in terms of developer experience that RSpec does not provide?
  • What gains does RSpec provide in terms of client success that the default test framework does not provide?
  • What gains does the default test framework provide in terms of client success that RSpec does not provide?
@stevepolitodesign stevepolitodesign added the Discussion Needs feedback label Dec 3, 2024
@DoodlingDev
Copy link
Contributor

Just as another datapoint, I asked on Blue Sky during Rubyconf what test framework people use and where would they like to see thoughtbot's investment to Rails testing open source go, and it was unanimously "rspec". To the degree that it's "so default" no one ever thinks about it.

@JoelQ
Copy link
Contributor

JoelQ commented Dec 4, 2024

In terms of developer experience:

  • 👍 RSpec provides better error messages
  • 👍 RSpec provides better tools for backfilling tests on legacy code
  • 🎨 spec-style writing seems more natural/less magical to me than repurposing methods in subclasses (I know that's controversial!)
  • 🎨 greater flexibility of RSpec allows for many different styles of writing it, so less consistency from spec to spec
  • 👎 greater flexibility of RSpec allows devs to play code golf with their specs
  • 👎 default test framework provides a better parallel testing story out of the box (I hear)
  • 👎 documentation for RSpec isn't great (not sure if default test framework is any better 🤷)

@stevepolitodesign
Copy link
Contributor Author

👍 RSpec provides better tools for backfilling tests on legacy code

In the context of Suspenders, that may not be relevant, since we'd be generating a new application.

👎 documentation for RSpec isn't great (not sure if default test framework is any better 🤷)

There's a whole section in the Guides dedicated to testing, which I personally think is valuable.

@stevepolitodesign stevepolitodesign changed the title How do we want to test new Rails applications? How do we want to test **new** Rails applications? Dec 4, 2024
@stevepolitodesign stevepolitodesign changed the title How do we want to test **new** Rails applications? How do we want to test *new* Rails applications? Dec 4, 2024
@nickcharlton
Copy link
Member

I do really like RSpec (I'm with @JoelQ on all of his points).

👎 documentation for RSpec isn't great (not sure if default test framework is any better 🤷)

Yeah. I was thinking about this the other day, when I was, for the nth time going around in circles trying to find something I knew existed in some form but couldn't quite remember. I'm not sure how to go about it (as in: I don't know what improvements I'd make), but it's been bouncing around my head the last few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Needs feedback
Projects
None yet
Development

No branches or pull requests

4 participants