Comments (6)
Hi @nickhammond
Thanks for the feedback and glad you enjoy retest.
Having a <changed>
reference for retest seems like an excellent idea. I'll think about how this could work out. Few things need to be considered like when <test>
and <changed>
are the same for example.
I'll definitely consider this for the next release but I can't promise a time frame.
from retest.
Hello @nickhammond
I have release v1.5.0 which allows you to do what you want.
Based on your example I would recommend using
retest 'bin/rails test <test> && bundle exec rubocop <changed>'
instead of
retest 'bin/rails test <test> && bundle exec rubocop <test> <changed>'
For example, if we have a post.rb
and post_test.rb
files. Here are the different scenarios
A change on post.rb
results in:
<changed> => post.rb
<test> => post_test.rb
A change on post_test.rb
results in:
<changed> => post_test.rb
<test> => post_test.rb
Let me know if this works as expected :)
Cheers
from retest.
This is great!! I'll give this a go tomorrow and let ya know.
from retest.
@AlexB52 Thanks for making this change!
Only feedback I have would be to update the "Files Selected" labels to match the placeholders, swap file:
with changed:
, your call though.
Files Selected:
- file: test/models/coupon_test.rb
- test: test/models/coupon_test.rb
retest 'bin/rails test <test> && bundle exec rubocop <changed>'
from retest.
@AlexB52 Having <test> <changed>
is actually intentional here so that Rubocop will run against both the test and the implementation file, this is to ensure that the cops run against the test files as well. Removing <test>
from the retest command only runs it against one file instead of two.
retest 'bin/rails test <test> && bundle exec rubocop <test> <changed>'
from retest.
Awesome thanks @nickhammond
Changing file
to changed
seems like a good idea. I'll create an issue for this.
Cheers
from retest.
Related Issues (20)
- Add <changed> placeholder in help command
- Remove the --auto flag
- Suggestion: Trap `Interrupt` signal (Ctrl+C) and exit gracefully HOT 5
- Allow configuring polling-based listener HOT 4
- Remove .ruby-version file?
- Default bundler gem inverts filename tests since 2.3.0 - Dec 2021
- Diff with Rake command is broken
- Retest defaults to `test_*.rb` pattern even when `*_test.rb` file exists
- Open retest to other watching tool than Listen
- retest --diff to run all tests in one go instead of per file
- --debug option HOT 1
- Open watch option to other files than ruby extensions.
- retest is confused if a file is called `rspec.rb` HOT 1
- Using = in the command breaks the command recognition HOT 1
- Replace file to changed on terminal output
- [FEATURE request] Listen to file changes and rerun all the spec from branch diffs
- [Feature Request] Terminal notification
- [Possible Bug] Spec file path not getting cached when using <test> ? HOT 9
- Move feature repositories to Ruby 2.7 and update gems support for 2.6 and above HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retest.