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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23aadaec28be102d543682e9b3e23a7dbae2ee9572b3d60ad8e8ddb714b949e3
4
- data.tar.gz: c4fdad4c83ac66b6cb2d4786c6aa97a4ea8a313f9144dd95054e24f935b6bdd2
3
+ metadata.gz: b06896aa8c54f39914f640cff29a301b872c5f97d9a18ccb6dede9872f32f864
4
+ data.tar.gz: b5074da6272aafe24eef835ff74fe1de432d7782d16ed74dfd97f4283b5448c6
5
5
  SHA512:
6
- metadata.gz: ed323c5833b8cbecc2dc2862de817e83e4571961a4c28c8d8a8bce0c92194806052ecb14384f2262fd83fe2e5e5fdb74744a296d979dd192a1d18fc9b9c20e88
7
- data.tar.gz: d87659d4b7a347c6e2c6bc159c7c6e66957b76643c5edc0d0c3f99c217e054f85635b118f4cdba02e8d31791b1c67e4754282af127c8c6389cd1d8851381e900
6
+ metadata.gz: f7f39b007ba14c7e91a3766475b2bc7666511bcdc579992a75e52b92e12fc13ac98c4c16306250f9dc22d46fbeb89240d2347cb5187ea70fdc48e2cc4e1644e4
7
+ data.tar.gz: 12be4588cfd66a318e3f88a30d56b2c9cf2f1e1ca97485a99ff13cfab2e593a332565bf051af464fcfb0c84739728c797547a57f2d48270d468052fc24b2d826
@@ -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
- rubocop (= 0.74.0)
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
@@ -1,4 +1,4 @@
1
- # minitest-stub_on_roids
1
+ # Minitest::StubOnRoids
2
2
 
3
3
  Provides a set of helper methods around Minitest's `Object#stub` method.
4
4
 
@@ -35,11 +35,10 @@ module Minitest
35
35
  end
36
36
  end
37
37
 
38
- def stub_and_expect(method_name, retval = nil, expected_args = [],
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 (!retval.nil? || expected_args.size.positive?) &&
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" if expectation[k].nil?
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
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: []