retest 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +6 -0
- data/lib/retest/command/base.rb +4 -0
- data/lib/retest/runner.rb +9 -8
- data/lib/retest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4173047ece3fb83e7ffc7e9cf871266054fc3dc49974f55a7df1afa6957afd73
|
4
|
+
data.tar.gz: c4c5a285c4d2f9195b289ca6746d1adba4f77f3fd76d5006c70b10c003fa8a2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d66970c4c9f952d936cd34fc5291ea7bb8a0f2366d90b2c2f647991b4e286936c1c8e37a8dcca8151954c8bd353dbe79321b23ea22e6a2ecf8a39b1ae2dcaf2
|
7
|
+
data.tar.gz: 3c172835d39561da42eee00fc99a6561f57854d6f9f6fb59c50613ac8619d8ee56a4349404d45228f87ba37bd95a6fec39b4b445cc81c0fee958c6aaa972fef8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
retest (2.0.
|
4
|
+
retest (2.0.1)
|
5
5
|
listen (~> 3.9)
|
6
6
|
observer (~> 0.1)
|
7
7
|
string-similarity (~> 2.1)
|
@@ -12,7 +12,7 @@ GEM
|
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
14
|
byebug (11.1.3)
|
15
|
-
ffi (1.17.
|
15
|
+
ffi (1.17.1)
|
16
16
|
listen (3.9.0)
|
17
17
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
18
18
|
rb-inotify (~> 0.9, >= 0.9.10)
|
data/README.md
CHANGED
@@ -14,6 +14,12 @@ With **zero setup required**, Retest works right out of the box on any Ruby proj
|
|
14
14
|
- **Customizable Workflows:** Tailor commands to your needs with placeholders, options, and interactive features.
|
15
15
|
- **Sound Notifications:** Get audible feedback for test results.
|
16
16
|
|
17
|
+
## 🎥 Demo
|
18
|
+
|
19
|
+
Discover Retest main functionalities in this small presentation
|
20
|
+
|
21
|
+
https://github.com/user-attachments/assets/5491bcad-134f-4843-9a6f-a474a1394e87
|
22
|
+
|
17
23
|
## 💡 **Why Use Retest?**
|
18
24
|
|
19
25
|
Testing frequently is the cornerstone of safe refactoring. Retest eliminates the friction of manual test execution by running tests after every file change, helping you stay just one `cmd + z` away from green tests.
|
data/lib/retest/command/base.rb
CHANGED
data/lib/retest/runner.rb
CHANGED
@@ -12,15 +12,22 @@ module Retest
|
|
12
12
|
def initialize(command, stdout: $stdout)
|
13
13
|
@stdout = stdout
|
14
14
|
@command = command
|
15
|
+
if command.hardcoded?
|
16
|
+
self.last_command = command.to_s
|
17
|
+
end
|
15
18
|
end
|
16
19
|
|
17
20
|
def run_last_command
|
21
|
+
unless last_command
|
22
|
+
return log('Error - Not enough information to run a command. Please trigger a run first.')
|
23
|
+
end
|
24
|
+
|
18
25
|
system_run last_command
|
19
26
|
end
|
20
27
|
|
21
28
|
def run(changed_files: [], test_files: [])
|
22
29
|
self.last_command = format_instruction(changed_files: changed_files, test_files: test_files)
|
23
|
-
|
30
|
+
run_last_command
|
24
31
|
rescue FileNotFound => e
|
25
32
|
log("FileNotFound - #{e.message}")
|
26
33
|
rescue Command::MultipleTestsNotSupported => e
|
@@ -29,7 +36,7 @@ module Retest
|
|
29
36
|
|
30
37
|
def run_all
|
31
38
|
self.last_command = command.clone(all: true).to_s
|
32
|
-
|
39
|
+
run_last_command
|
33
40
|
end
|
34
41
|
|
35
42
|
def format_instruction(changed_files: [], test_files: [])
|
@@ -77,12 +84,6 @@ module Retest
|
|
77
84
|
|
78
85
|
private
|
79
86
|
|
80
|
-
def print_test_file_not_found
|
81
|
-
log(<<~ERROR)
|
82
|
-
FileNotFound - Retest could not find a matching test file to run.
|
83
|
-
ERROR
|
84
|
-
end
|
85
|
-
|
86
87
|
def system_run(command)
|
87
88
|
log("\n")
|
88
89
|
result = system(command) ? :tests_pass : :tests_fail
|
data/lib/retest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: retest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Barret
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: string-similarity
|