spy 0.4.3 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/spy/subroutine.rb +1 -0
- data/lib/spy/version.rb +1 -1
- data/test/spy/test_subroutine.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 459078e1b4845518e7c5e484f86d9b60fe804b89
|
4
|
+
data.tar.gz: c4723869289fb3afcba314f16c2f0c9cd5f4a1ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9686fc4befa165a861d1e9bb862902e02b153a0584961af9b672c225d8206720f2894d33f64062a8d7b8f4ee0cadd6461ae9cd7c12c9d584fc7ad879faaf6d7e
|
7
|
+
data.tar.gz: 53892408f38307099ecc5ccf7864fbd899f3150c238b71fd8189f561589d702b5d025ed3a5a59800e7caac7277c2d8f98d3f82d99ab647740d164ab98ce067dd
|
data/CHANGELOG.md
CHANGED
data/lib/spy/subroutine.rb
CHANGED
data/lib/spy/version.rb
CHANGED
data/test/spy/test_subroutine.rb
CHANGED
@@ -86,6 +86,18 @@ module Spy
|
|
86
86
|
assert_equal result, @pen.write(nil)
|
87
87
|
end
|
88
88
|
|
89
|
+
def test_spy_and_raise_raises_the_set_exception
|
90
|
+
pen_write_spy = spy_on(@pen, :write).and_raise(ArgumentError, "problems!")
|
91
|
+
assert_kind_of Subroutine, pen_write_spy
|
92
|
+
assert_equal [pen_write_spy], Agency.instance.spies
|
93
|
+
|
94
|
+
e = assert_raises ArgumentError do
|
95
|
+
@pen.write(nil)
|
96
|
+
end
|
97
|
+
assert_equal "problems!", e.message
|
98
|
+
assert pen_write_spy.has_been_called?
|
99
|
+
end
|
100
|
+
|
89
101
|
def test_spy_and_return_can_call_a_block
|
90
102
|
result = "hello world"
|
91
103
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Ong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.5.1
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: A simple modern mocking library that uses the spy pattern and checks method's
|