-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add rake task to run spec for all Ruby versions #129
Conversation
task :all do |task| | ||
RUBIES.each do |ruby_v| | ||
puts "\n\n\nUsing #{ruby_v}\n\n\n" | ||
puts `bash -lc "rvm use #{ruby_v}; rspec spec"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rspec provides a class for defining rake tasks. I think RVM has it's own Ruby API too. Use that. What if the user is not using bash? Or if he does not have bash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the user is not using bash? Or if he does not have bash?
Point! I will have a look upon what RVM API has to offer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checkout the new solution. It makes use of RVM generated wrappers.
OK so this is one part of the solution. But if there is a failure in Ruby 2.0.0, I will need to scroll all the way up to see that. It should ideally print the test report (number of tests passed and failures) for each ruby version at the bottom of the terminal output, so that in case there are failures, I know where to look instantly. |
Btw it should also run rubocop. |
How about just printing the number of passed/failed for each Ruby? The user can just change Ruby version and run rspec if he wants to know about the failures. |
Yeah that works too. Make sure you use appropriate colours (red for fail, green for pass). |
Ok. I did like I said but adding colors would need a little more work. Should the rubocop also run in this same task or should I create another task for it? |
You can add the :cop task as a subtask of :all. |
|
Color support is added. Now |
"(files took #{message.formatted_load_time} to load)\n" \ | ||
"#{message.colorized_totals_line(colorizer)}\n" | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to Patrick Koperwas for he made it possible just print the number of pass/failed examples with colors. Here's his answer that helped me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about rename this file to .rspec_formatter.rb
so that its explicit that it's rspec and it stays hidden too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@v0dro I think this is ready to be merged. Just a small thing. Please specify the complete versions names to be tested. Currently I have these: https://github.com/v0dro/daru/pull/129/files#diff-52c976fc38ed2b4e3b1192f8a8e24cffR7 |
For #124
Create a rake task to test the specs in all Ruby versions automatically and display the result.
Tests for all versions are ran using
rake all
.