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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60daeb7dc9a4b41de1284dcc4353bcf278ddce75
4
- data.tar.gz: 93534dcf719a49ac1907e585d6633cd561cd2546
3
+ metadata.gz: 459078e1b4845518e7c5e484f86d9b60fe804b89
4
+ data.tar.gz: c4723869289fb3afcba314f16c2f0c9cd5f4a1ac
5
5
  SHA512:
6
- metadata.gz: c4177bc16ff8d22aa2236bdcfa35c79248bf73ef93117c91a75d0c7515a71d2a833304df1abf893905992f4765bf4b92c530fd7807f6421ea18ec4bead99e75a
7
- data.tar.gz: 2d803b1a5ddac06a0f218a963cf01e0be05a9d4bb835f3ff86e7edb49e4dd22b88844ebe4ca65348e85def83ef1c125220a52ed31a9536d4a5fa8fa54f52a63e
6
+ metadata.gz: 9686fc4befa165a861d1e9bb862902e02b153a0584961af9b672c225d8206720f2894d33f64062a8d7b8f4ee0cadd6461ae9cd7c12c9d584fc7ad879faaf6d7e
7
+ data.tar.gz: 53892408f38307099ecc5ccf7864fbd899f3150c238b71fd8189f561589d702b5d025ed3a5a59800e7caac7277c2d8f98d3f82d99ab647740d164ab98ce067dd
@@ -1,3 +1,7 @@
1
+ ## Spy 0.4.3 (Not Released) ##
2
+
3
+ * Not Released
4
+
1
5
  ## Spy 0.4.3 (April 14, 2016) ##
2
6
 
3
7
  * Double performance of spy lookups (@BlakeMesdag)
@@ -167,6 +167,7 @@ module Spy
167
167
  end
168
168
 
169
169
  @plan = Proc.new { raise exception }
170
+ self
170
171
  end
171
172
 
172
173
  # @overload and_throw(symbol)
@@ -1,3 +1,3 @@
1
1
  module Spy
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.5"
3
3
  end
@@ -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.3
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-04-14 00:00:00.000000000 Z
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.6.1
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