minitest-stub_on_roids 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +16 -1
- data/README.md +1 -1
- data/lib/minitest/stub_on_roids.rb +3 -4
- metadata +73 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b06896aa8c54f39914f640cff29a301b872c5f97d9a18ccb6dede9872f32f864
|
4
|
+
data.tar.gz: b5074da6272aafe24eef835ff74fe1de432d7782d16ed74dfd97f4283b5448c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7f39b007ba14c7e91a3766475b2bc7666511bcdc579992a75e52b92e12fc13ac98c4c16306250f9dc22d46fbeb89240d2347cb5187ea70fdc48e2cc4e1644e4
|
7
|
+
data.tar.gz: 12be4588cfd66a318e3f88a30d56b2c9cf2f1e1ca97485a99ff13cfab2e593a332565bf051af464fcfb0c84739728c797547a57f2d48270d468052fc24b2d826
|
data/Gemfile.lock
CHANGED
@@ -2,16 +2,27 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
minitest-stub_on_roids (0.0.4)
|
5
|
+
minitest (>= 5.0)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
10
|
+
ansi (1.5.0)
|
9
11
|
ast (2.4.0)
|
12
|
+
builder (3.2.4)
|
13
|
+
byebug (11.0.1)
|
10
14
|
jaro_winkler (1.5.3)
|
15
|
+
minitest (5.13.0)
|
16
|
+
minitest-reporters (1.4.2)
|
17
|
+
ansi
|
18
|
+
builder
|
19
|
+
minitest (>= 5.0)
|
20
|
+
ruby-progressbar
|
11
21
|
parallel (1.17.0)
|
12
22
|
parser (2.6.4.0)
|
13
23
|
ast (~> 2.4.0)
|
14
24
|
rainbow (3.0.0)
|
25
|
+
rake (13.0.1)
|
15
26
|
rubocop (0.74.0)
|
16
27
|
jaro_winkler (~> 1.5.1)
|
17
28
|
parallel (~> 1.10)
|
@@ -26,8 +37,12 @@ PLATFORMS
|
|
26
37
|
ruby
|
27
38
|
|
28
39
|
DEPENDENCIES
|
40
|
+
bundler (>= 2.0.0)
|
41
|
+
byebug
|
42
|
+
minitest-reporters (>= 1.4.0)
|
29
43
|
minitest-stub_on_roids!
|
30
|
-
|
44
|
+
rake (>= 13.0.0)
|
45
|
+
rubocop (~> 0.74.0)
|
31
46
|
|
32
47
|
BUNDLED WITH
|
33
48
|
2.0.1
|
data/README.md
CHANGED
@@ -35,11 +35,10 @@ module Minitest
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
def stub_and_expect(method_name, retval =
|
38
|
+
def stub_and_expect(method_name, retval = :retval_placeholder, expected_args = [],
|
39
39
|
times: 1, expectations: [])
|
40
40
|
raise_if_bad_args(retval, expected_args, expectations)
|
41
41
|
raise_if_already_stubbed(method_name)
|
42
|
-
|
43
42
|
mock = build_mock(retval, expected_args, times, expectations)
|
44
43
|
|
45
44
|
stub(method_name, mock) do
|
@@ -80,7 +79,7 @@ module Minitest
|
|
80
79
|
end
|
81
80
|
|
82
81
|
def raise_if_bad_args(retval, expected_args, expectations)
|
83
|
-
if (
|
82
|
+
if (!:retval_placeholder.eql?(retval) || expected_args.size.positive?) &&
|
84
83
|
expectations.size.positive?
|
85
84
|
raise ArgumentError,
|
86
85
|
"`retval` and `expected_args` arguments cannot be passed along with `expectations`"
|
@@ -89,7 +88,7 @@ module Minitest
|
|
89
88
|
|
90
89
|
def validate_expectation(expectation)
|
91
90
|
%i[expected_args return_value].each do |k|
|
92
|
-
raise ArgumentError, "Missing key #{k} in expectation definition"
|
91
|
+
raise ArgumentError, "Missing key #{k} in expectation definition" unless expectation.key?(k)
|
93
92
|
end
|
94
93
|
end
|
95
94
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-stub_on_roids
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Nizov
|
@@ -10,20 +10,90 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest-reporters
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.4'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.4'
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: rubocop
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
16
44
|
requirements:
|
17
|
-
- -
|
45
|
+
- - "~>"
|
18
46
|
- !ruby/object:Gem::Version
|
19
47
|
version: 0.74.0
|
20
48
|
type: :development
|
21
49
|
prerelease: false
|
22
50
|
version_requirements: !ruby/object:Gem::Requirement
|
23
51
|
requirements:
|
24
|
-
- -
|
52
|
+
- - "~>"
|
25
53
|
- !ruby/object:Gem::Version
|
26
54
|
version: 0.74.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '13'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '13'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '11'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '11'
|
27
97
|
description: A set of helper methods based around Minitest's Object#stub method.
|
28
98
|
email: simon.nizov@gmail.com
|
29
99
|
executables: []
|