rspec-sorbet-types 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec/sorbet/types/version.rb +10 -0
- data/lib/rspec/sorbet/types.rb +4 -0
- data/lib/tapioca/dsl/compilers/rspec.rb +19 -3
- data/rbi/rspec-core.rbi +18 -18
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38115893c2185828951d0b6afce7710c0a9999999a6abec57496f1e97a9723b9
|
4
|
+
data.tar.gz: e9fb71bee0b47caae7500716f2e3c45d888e010607272a520c92916391a2bce6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99b1a3ee08b1a3b24d1c04c6e2349c00ee8005eb88de4e58546b8fc77b607278fa2aadb7e1fed4b9c7d03253703591c11b3dbb767de0d52eae225484c39a6b4d
|
7
|
+
data.tar.gz: 27af9e068c9ff987364d5bb8d65aaf43e35af38651520d6a4a426d9defe0a94677a1e4d0c42a023ce441f4262b389904673297add2ba93ae67192a1e83c37cff
|
data/lib/rspec/sorbet/types.rb
CHANGED
@@ -21,16 +21,31 @@ module Tapioca
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
+
sig { void }
|
25
|
+
def add_spec_dir_to_load_path!
|
26
|
+
$LOAD_PATH.unshift(spec_dir)
|
27
|
+
end
|
28
|
+
|
24
29
|
sig { void }
|
25
30
|
def require_spec_files!
|
26
|
-
Dir.glob(spec_glob).each do |
|
27
|
-
require(
|
31
|
+
Dir.glob(spec_glob, base: spec_dir).each do |path|
|
32
|
+
require(strip_rb_suffix(path))
|
28
33
|
end
|
29
34
|
end
|
30
35
|
|
36
|
+
sig { returns(String) }
|
37
|
+
def spec_dir
|
38
|
+
ENV["SORBET_RSPEC_DIR"] || File.join(Dir.pwd, "spec")
|
39
|
+
end
|
40
|
+
|
31
41
|
sig { returns(String) }
|
32
42
|
def spec_glob
|
33
|
-
ENV["SORBET_RSPEC_GLOB"] || File.join("
|
43
|
+
ENV["SORBET_RSPEC_GLOB"] || File.join("**", "*.rb")
|
44
|
+
end
|
45
|
+
|
46
|
+
sig { params(path: T.any(String, Pathname)).returns(String) }
|
47
|
+
def strip_rb_suffix(path)
|
48
|
+
path.sub(/\.rb$/, "").to_s
|
34
49
|
end
|
35
50
|
end
|
36
51
|
|
@@ -38,6 +53,7 @@ module Tapioca
|
|
38
53
|
ENV["SORBET_RSPEC_TYPES_COMPILING"] = "1"
|
39
54
|
|
40
55
|
# Load all spec files during compiler definition
|
56
|
+
add_spec_dir_to_load_path!
|
41
57
|
require_spec_files!
|
42
58
|
|
43
59
|
sig { override.void }
|
data/rbi/rspec-core.rbi
CHANGED
@@ -6,11 +6,11 @@ module RSpec
|
|
6
6
|
sig do
|
7
7
|
params(
|
8
8
|
args: T.untyped,
|
9
|
-
example_group_block: T.proc.bind(T.class_of(RSpec::Core::ExampleGroup)).void
|
9
|
+
example_group_block: T.proc.bind(T.class_of(RSpec::Core::ExampleGroup)).void
|
10
10
|
).void
|
11
11
|
end
|
12
|
-
|
13
|
-
|
12
|
+
def describe(*args, &example_group_block)
|
13
|
+
end
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -22,46 +22,46 @@ class RSpec::Core::ExampleGroup
|
|
22
22
|
sig do
|
23
23
|
params(
|
24
24
|
all_args: T.untyped,
|
25
|
-
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
25
|
+
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
26
26
|
).void
|
27
27
|
end
|
28
|
-
|
29
|
-
|
28
|
+
def it(*all_args, &block)
|
29
|
+
end
|
30
30
|
|
31
31
|
sig do
|
32
32
|
params(
|
33
33
|
all_args: T.untyped,
|
34
|
-
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
34
|
+
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
35
35
|
).void
|
36
36
|
end
|
37
|
-
|
38
|
-
|
37
|
+
def specify(*all_args, &block)
|
38
|
+
end
|
39
39
|
|
40
40
|
sig do
|
41
41
|
params(
|
42
42
|
args: T.untyped,
|
43
|
-
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
43
|
+
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
44
44
|
).void
|
45
45
|
end
|
46
|
-
|
47
|
-
|
46
|
+
def before(*args, &block)
|
47
|
+
end
|
48
48
|
|
49
49
|
sig do
|
50
50
|
params(
|
51
51
|
args: T.untyped,
|
52
|
-
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
52
|
+
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
53
53
|
).void
|
54
54
|
end
|
55
|
-
|
56
|
-
|
55
|
+
def after(*args, &block)
|
56
|
+
end
|
57
57
|
|
58
58
|
sig do
|
59
59
|
params(
|
60
60
|
args: T.untyped,
|
61
|
-
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
61
|
+
block: T.proc.bind(RSpec::Core::ExampleGroup).void
|
62
62
|
).void
|
63
63
|
end
|
64
|
-
|
65
|
-
|
64
|
+
def around(*args, &block)
|
65
|
+
end
|
66
66
|
end
|
67
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-sorbet-types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hongli Lai
|
@@ -62,14 +62,15 @@ extra_rdoc_files: []
|
|
62
62
|
files:
|
63
63
|
- lib/rspec/sorbet/types.rb
|
64
64
|
- lib/rspec/sorbet/types/sig.rb
|
65
|
+
- lib/rspec/sorbet/types/version.rb
|
65
66
|
- lib/tapioca/dsl/compilers/rspec.rb
|
66
67
|
- rbi/rspec-core.rbi
|
67
|
-
homepage: https://github.com/FooBarWidget/sorbet-
|
68
|
+
homepage: https://github.com/FooBarWidget/rspec-sorbet-types
|
68
69
|
licenses:
|
69
70
|
- MIT
|
70
71
|
metadata:
|
71
|
-
homepage_uri: https://github.com/FooBarWidget/sorbet-
|
72
|
-
source_code_uri: https://github.com/FooBarWidget/sorbet-
|
72
|
+
homepage_uri: https://github.com/FooBarWidget/rspec-sorbet-types
|
73
|
+
source_code_uri: https://github.com/FooBarWidget/rspec-sorbet-types
|
73
74
|
post_install_message:
|
74
75
|
rdoc_options: []
|
75
76
|
require_paths:
|
@@ -85,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
86
|
- !ruby/object:Gem::Version
|
86
87
|
version: '0'
|
87
88
|
requirements: []
|
88
|
-
rubygems_version: 3.5.
|
89
|
+
rubygems_version: 3.5.22
|
89
90
|
signing_key:
|
90
91
|
specification_version: 4
|
91
92
|
summary: Sorbet integration for RSpec
|