running many tests

11 views
Skip to first unread message

Joao Miguel Ferreira

unread,
Nov 30, 2020, 7:41:19 AM11/30/20
to rspec
Hello all,

I'm just starting with rspec and with ruby. I have read the examples and I can run rspec tests with "ruby my_test.rb".

Is there a way to run many tests? something like a test battery or "please run all tests in my_tests directory" ?

Is there something like "best practices" on this matter?

thank you
João

Phil Pirozhkov

unread,
Nov 30, 2020, 7:57:17 AM11/30/20
to Jack Royal-Gordon
Joao,

You normally (after running `rspec --init`) add spec files under `spec` directory, and name them something like `user_spec.rb`.

And run either focused to one spec file (https://relishapp.com/rspec/rspec-core/v/3-10/docs/command-line/line-number-appended-to-file-path) with `rspec spec/my_spec.rb`, or run all your specs with just `rspec`.

All the documentation is available here http://rspec.info/documentation/
I can recommend checking the community RSpec style guide https://rspec.rubystyle.guide/

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/a8a5871d-8cee-448f-8969-54dbdc8c63f5n%40googlegroups.com.

Joao Miguel Ferreira

unread,
Nov 30, 2020, 10:04:04 AM11/30/20
to rspec
Hi Phil,

thank you very much

Joao
Reply all
Reply to author
Forward
0 new messages