runfile-tasks 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/runfile-tasks/testing/rspec.rb +45 -45
- data/lib/runfile-tasks/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: b2a4bcc6d9df171a074aa70c2ec1c820a217872b2df3f50a19dac55737402499
|
4
|
+
data.tar.gz: 23f351be635729cd26708da82b4beeb3e8a710e9742a00932e8fd6ac510b7fc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fd11271922627823e6e306281d41ad8a4239f38378ccc31615cadf35607f1902634d97f95a5e8828fcdcb4b699013b79fb1720e1a4d710b7b74752d1a143638
|
7
|
+
data.tar.gz: 4cde89841935252c75bbea34cee09e381b57aeff2fc634aa4528109522f2c652017f1d14da731e4ddb07b163588b1874a088dd142080ca607e688d0f4d5c7507
|
@@ -1,45 +1,45 @@
|
|
1
|
-
module RunfileTasks
|
2
|
-
module Testing
|
3
|
-
extend self
|
4
|
-
|
5
|
-
def rspec(opts={})
|
6
|
-
opts = { action: opts } if opts.is_a? String
|
7
|
-
|
8
|
-
opts = {
|
9
|
-
action: 'spec',
|
10
|
-
pattern: './spec/**/*_spec.rb',
|
11
|
-
command: 'rspec'
|
12
|
-
}.merge opts
|
13
|
-
|
14
|
-
usage "#{opts[:action]} [NAME] [TAG]"
|
15
|
-
help "Run all specs or a single spec file matching a regex. You can provide a tag to run only specific tests. If you wish to provide a tag only, without a file pattern, simply prefix the tag with a colon, like 'run spec :focus'"
|
16
|
-
action opts[:action].to_sym do |args|
|
17
|
-
file = args['NAME']
|
18
|
-
tag = args['TAG']
|
19
|
-
|
20
|
-
if file and file[0] == ':'
|
21
|
-
tag = file
|
22
|
-
file = nil
|
23
|
-
end
|
24
|
-
|
25
|
-
if tag and tag[0] == ':'
|
26
|
-
tag = tag[1..-1]
|
27
|
-
end
|
28
|
-
|
29
|
-
if file
|
30
|
-
files = Dir[opts[:pattern]]
|
31
|
-
files.select! { |f| f =~ /#{file}/i }
|
32
|
-
abort "Cannot find a matching spec file with #{opts[:pattern]}" if files.empty?
|
33
|
-
file = files.first
|
34
|
-
cmd = "#{opts[:command]} \"#{file}\""
|
35
|
-
else
|
36
|
-
cmd = "#{opts[:command]}"
|
37
|
-
end
|
38
|
-
cmd = "#{cmd} --tag #{tag}" if tag
|
39
|
-
say "!txtgrn!Running: !txtpur!#{cmd}"
|
40
|
-
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
1
|
+
module RunfileTasks
|
2
|
+
module Testing
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def rspec(opts={})
|
6
|
+
opts = { action: opts } if opts.is_a? String
|
7
|
+
|
8
|
+
opts = {
|
9
|
+
action: 'spec',
|
10
|
+
pattern: './spec/**/*_spec.rb',
|
11
|
+
command: 'rspec'
|
12
|
+
}.merge opts
|
13
|
+
|
14
|
+
usage "#{opts[:action]} [NAME] [TAG]"
|
15
|
+
help "Run all specs or a single spec file matching a regex. You can provide a tag to run only specific tests. If you wish to provide a tag only, without a file pattern, simply prefix the tag with a colon, like 'run spec :focus'"
|
16
|
+
action opts[:action].to_sym do |args|
|
17
|
+
file = args['NAME']
|
18
|
+
tag = args['TAG']
|
19
|
+
|
20
|
+
if file and file[0] == ':'
|
21
|
+
tag = file
|
22
|
+
file = nil
|
23
|
+
end
|
24
|
+
|
25
|
+
if tag and tag[0] == ':'
|
26
|
+
tag = tag[1..-1]
|
27
|
+
end
|
28
|
+
|
29
|
+
if file
|
30
|
+
files = Dir[opts[:pattern]]
|
31
|
+
files.select! { |f| f =~ /#{file}/i }
|
32
|
+
abort "Cannot find a matching spec file with #{opts[:pattern]}" if files.empty?
|
33
|
+
file = files.first
|
34
|
+
cmd = "#{opts[:command]} \"#{file}\""
|
35
|
+
else
|
36
|
+
cmd = "#{opts[:command]}"
|
37
|
+
end
|
38
|
+
cmd = "#{cmd} --tag #{tag}" if tag
|
39
|
+
say "!txtgrn!Running: !txtpur!#{cmd}"
|
40
|
+
exec cmd
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runfile-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: runfile
|