retest 1.1.0 → 1.2.0
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/.github/workflows/ci.yml +3 -2
- data/Gemfile.lock +2 -2
- data/README.md +14 -4
- data/bin/test/ruby-bare +6 -0
- data/lib/retest.rb +1 -0
- data/lib/retest/command/rails.rb +4 -4
- data/lib/retest/command/rake.rb +4 -4
- data/lib/retest/command/rspec.rb +4 -4
- data/lib/retest/command/ruby.rb +8 -6
- data/lib/retest/file_system.rb +9 -0
- data/lib/retest/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13ce5e74ba4682f3777259a6565c585271dd7db5f6d753c4e5d6836f5c457634
|
4
|
+
data.tar.gz: bfc62c5fd481982435b3ee8e372839b7678e489d8123bbcd629c5ba56c2b7012
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef3ee2efb84b012c5b6ba340d81e578ec512960e7fc28516abbc23689c8ad43f3c3a5ecd1855d51df1bcee5a426fdd92aef3f460a65fbb7c39d35d83ad08c735
|
7
|
+
data.tar.gz: e5af1bbe78c6bfa347088fc0ec3c8e985a1dbad5393f47640b7885cf4a0bbdd5cbc8c8922f7b189794027af4e7091dc36fd81693e5d785cf11e330fd2ea78dc0
|
data/.github/workflows/ci.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
retest (1.
|
4
|
+
retest (1.2.0)
|
5
5
|
listen (~> 3.2)
|
6
6
|
string-similarity (~> 2.1)
|
7
7
|
tty-option (~> 0.1)
|
@@ -16,7 +16,7 @@ GEM
|
|
16
16
|
rb-inotify (~> 0.9, >= 0.9.10)
|
17
17
|
minitest (5.14.1)
|
18
18
|
rake (12.3.3)
|
19
|
-
rb-fsevent (0.
|
19
|
+
rb-fsevent (0.11.0)
|
20
20
|
rb-inotify (0.10.1)
|
21
21
|
ffi (~> 1.0)
|
22
22
|
string-similarity (2.1.0)
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://badge.fury.io/rb/retest)
|
2
|
+
|
1
3
|
# Retest
|
2
4
|
|
3
5
|
Retest is a small command-line tool to help you refactor code by watching a file change and running its matching spec. Designed to be dev-centric and project independent, it can be used on the fly. No Gemfile updates, no commits to a repo or configuration files required to start refactoring. Works with every Ruby projects (at least that is the end goal)
|
@@ -13,6 +15,7 @@ Install it on your machine without adding it on a Gemfile:
|
|
13
15
|
$ gem install retest
|
14
16
|
|
15
17
|
## Usage
|
18
|
+
### Refactoring
|
16
19
|
|
17
20
|
Launch `retest` in your terminal after accessing your ruby repository.
|
18
21
|
|
@@ -28,11 +31,10 @@ Few shortcut flags exist to avoid writing the full test command.
|
|
28
31
|
$ retest --rails
|
29
32
|
$ retest --rake --all
|
30
33
|
|
31
|
-
|
34
|
+
Or let retest find your ruby setup and run the appropriate command using:
|
32
35
|
|
33
36
|
$ retest
|
34
|
-
$ retest --
|
35
|
-
$ retest --auto --all
|
37
|
+
$ retest --all
|
36
38
|
|
37
39
|
The gem works as follows:
|
38
40
|
|
@@ -41,7 +43,15 @@ The gem works as follows:
|
|
41
43
|
* When multiple matching test files are found, retest asks you to confirm the file and save the answer.
|
42
44
|
* When a test file is not found, retest runs the last run command or throw a 404.
|
43
45
|
|
44
|
-
|
46
|
+
### Diff Check
|
47
|
+
|
48
|
+
You can diff a branch and test all the relevant test files before pushing your branch and trigger the full CI suite.
|
49
|
+
|
50
|
+
$ retest --diff origin/main
|
51
|
+
|
52
|
+
### Help
|
53
|
+
|
54
|
+
See more examples with `retest -h`
|
45
55
|
|
46
56
|
```
|
47
57
|
Usage: retest [OPTIONS] [COMMAND]
|
data/bin/test/ruby-bare
ADDED
data/lib/retest.rb
CHANGED
data/lib/retest/command/rails.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Retest
|
2
2
|
class Command
|
3
|
-
Rails = Struct.new(:all, :
|
4
|
-
def self.command(all:,
|
5
|
-
new(all,
|
3
|
+
Rails = Struct.new(:all, :file_system) do
|
4
|
+
def self.command(all:, file_system: FileSystem)
|
5
|
+
new(all, file_system).command
|
6
6
|
end
|
7
7
|
|
8
8
|
def command
|
@@ -13,7 +13,7 @@ module Retest
|
|
13
13
|
private
|
14
14
|
|
15
15
|
def root_command
|
16
|
-
return 'bin/rails test' if
|
16
|
+
return 'bin/rails test' if file_system.exist? 'bin/rails'
|
17
17
|
|
18
18
|
'bundle exec rails test'
|
19
19
|
end
|
data/lib/retest/command/rake.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Retest
|
2
2
|
class Command
|
3
|
-
Rake = Struct.new(:all, :
|
4
|
-
def self.command(all:,
|
5
|
-
new(all,
|
3
|
+
Rake = Struct.new(:all, :file_system) do
|
4
|
+
def self.command(all:, file_system: FileSystem)
|
5
|
+
new(all, file_system).command
|
6
6
|
end
|
7
7
|
|
8
8
|
def command
|
@@ -13,7 +13,7 @@ module Retest
|
|
13
13
|
private
|
14
14
|
|
15
15
|
def root_command
|
16
|
-
return 'bin/rake test' if
|
16
|
+
return 'bin/rake test' if file_system.exist? 'bin/rake'
|
17
17
|
|
18
18
|
'bundle exec rake test'
|
19
19
|
end
|
data/lib/retest/command/rspec.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Retest
|
2
2
|
class Command
|
3
|
-
Rspec = Struct.new(:all, :
|
4
|
-
def self.command(all:,
|
5
|
-
new(all,
|
3
|
+
Rspec = Struct.new(:all, :file_system) do
|
4
|
+
def self.command(all:, file_system: FileSystem)
|
5
|
+
new(all, file_system).command
|
6
6
|
end
|
7
7
|
|
8
8
|
def command
|
@@ -13,7 +13,7 @@ module Retest
|
|
13
13
|
private
|
14
14
|
|
15
15
|
def root_command
|
16
|
-
return 'bin/rspec' if
|
16
|
+
return 'bin/rspec' if file_system.exist? 'bin/rspec'
|
17
17
|
|
18
18
|
'bundle exec rspec'
|
19
19
|
end
|
data/lib/retest/command/ruby.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
module Retest
|
2
2
|
class Command
|
3
|
-
Ruby
|
4
|
-
|
5
|
-
new(false, false).command
|
6
|
-
end
|
3
|
+
module Ruby
|
4
|
+
module_function
|
7
5
|
|
8
|
-
def command
|
9
|
-
|
6
|
+
def command(all: false, file_system: FileSystem)
|
7
|
+
if file_system.exist? 'Gemfile.lock'
|
8
|
+
'bundle exec ruby <test>'
|
9
|
+
else
|
10
|
+
'ruby <test>'
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
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: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Barret
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: string-similarity
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- bin/test/rspec-rails
|
79
79
|
- bin/test/rspec-ruby
|
80
80
|
- bin/test/ruby-app
|
81
|
+
- bin/test/ruby-bare
|
81
82
|
- exe/retest
|
82
83
|
- lib/retest.rb
|
83
84
|
- lib/retest/command.rb
|
@@ -85,6 +86,7 @@ files:
|
|
85
86
|
- lib/retest/command/rake.rb
|
86
87
|
- lib/retest/command/rspec.rb
|
87
88
|
- lib/retest/command/ruby.rb
|
89
|
+
- lib/retest/file_system.rb
|
88
90
|
- lib/retest/options.rb
|
89
91
|
- lib/retest/repository.rb
|
90
92
|
- lib/retest/runner.rb
|