assert 2.18.1 → 2.18.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assert.gemspec +2 -2
- data/lib/assert/stub.rb +8 -0
- data/lib/assert/version.rb +1 -1
- data/test/unit/assert_tests.rb +42 -0
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93616ac8a1849d9f356088b0386907f946cf89465e84aaa6321ceff60f7012de
|
4
|
+
data.tar.gz: a4436d1c9d437cb56343318885b1a32d804ad2e71c956408cd877d695f3d9675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 424110cb0d83c44fcdc66129532bc53859a74a0b2f63f2b08081955d6aee813a9df11f37afbdc325f464866ca0263fc98164992d08949fa2573410f9056334c6
|
7
|
+
data.tar.gz: 25b2980b91b9e4dddf9724f64cbdc81214c910008157f0ac88f3e3a1c6f4ae8162065d08ef4a2c2eb78ff2211cdc49fdac893397e50e04b5816174eb8293c01b
|
data/assert.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.required_ruby_version = "~> 2.
|
21
|
+
gem.required_ruby_version = "~> 2.5"
|
22
22
|
|
23
23
|
gem.add_dependency("much-factory", ["~> 0.1.0"])
|
24
|
-
gem.add_dependency("much-stub", ["~> 0.1.
|
24
|
+
gem.add_dependency("much-stub", ["~> 0.1.3"])
|
25
25
|
end
|
data/lib/assert/stub.rb
CHANGED
@@ -30,4 +30,12 @@ module Assert
|
|
30
30
|
def self.stub_tap(*args, &block)
|
31
31
|
MuchStub.tap(*args, &block)
|
32
32
|
end
|
33
|
+
|
34
|
+
def self.stub_tap_on_call(*args, &block)
|
35
|
+
MuchStub.tap_on_call(*args, &block)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.stub_spy(*args, &block)
|
39
|
+
MuchStub.spy(*args, &block)
|
40
|
+
end
|
33
41
|
end
|
data/lib/assert/version.rb
CHANGED
data/test/unit/assert_tests.rb
CHANGED
@@ -114,5 +114,47 @@ module Assert
|
|
114
114
|
assert_equal @orig_value, @myobj.mymeth
|
115
115
|
assert_equal [], my_meth_called_with
|
116
116
|
end
|
117
|
+
|
118
|
+
should "be able to add a stub tap with an on_call block" do
|
119
|
+
my_meth_called_with = nil
|
120
|
+
Assert.stub_tap_on_call(@myobj, :mymeth){ |value, call|
|
121
|
+
my_meth_called_with = call
|
122
|
+
}
|
123
|
+
|
124
|
+
assert_equal @orig_value, @myobj.mymeth
|
125
|
+
assert_equal [], my_meth_called_with.args
|
126
|
+
end
|
127
|
+
|
128
|
+
should "be able to add a stubbed spy" do
|
129
|
+
myclass = Class.new do
|
130
|
+
def one; self; end
|
131
|
+
def two(val); self; end
|
132
|
+
def three; self; end
|
133
|
+
def ready?; false; end
|
134
|
+
end
|
135
|
+
myobj = myclass.new
|
136
|
+
|
137
|
+
spy =
|
138
|
+
Assert.stub_spy(
|
139
|
+
myobj,
|
140
|
+
:one,
|
141
|
+
:two,
|
142
|
+
:three,
|
143
|
+
ready?: true)
|
144
|
+
|
145
|
+
assert_equal spy, myobj.one
|
146
|
+
assert_equal spy, myobj.two("a")
|
147
|
+
assert_equal spy, myobj.three
|
148
|
+
|
149
|
+
assert_true myobj.one.two("b").three.ready?
|
150
|
+
|
151
|
+
assert_kind_of MuchStub::CallSpy, spy
|
152
|
+
assert_equal 2, spy.one_call_count
|
153
|
+
assert_equal 2, spy.two_call_count
|
154
|
+
assert_equal 2, spy.three_call_count
|
155
|
+
assert_equal 1, spy.ready_predicate_call_count
|
156
|
+
assert_equal ["b"], spy.two_last_called_with.args
|
157
|
+
assert_true spy.ready_predicate_called?
|
158
|
+
end
|
117
159
|
end
|
118
160
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.18.
|
4
|
+
version: 2.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: much-factory
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.1.
|
34
|
+
version: 0.1.3
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.1.
|
41
|
+
version: 0.1.3
|
42
42
|
description: Assertion style testing framework.
|
43
43
|
email:
|
44
44
|
- kelly@kellyredding.com
|
@@ -136,15 +136,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
136
|
requirements:
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: '2.
|
139
|
+
version: '2.5'
|
140
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
|
-
|
147
|
-
rubygems_version: 2.7.6.2
|
146
|
+
rubygems_version: 3.1.2
|
148
147
|
signing_key:
|
149
148
|
specification_version: 4
|
150
149
|
summary: Assertion style testing framework.
|