gimme 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.5.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gimme"
8
- s.version = "0.4.1"
8
+ s.version = "0.5.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Searls"]
12
- s.date = "2013-12-23"
12
+ s.date = "2014-02-02"
13
13
  s.description = "gimme attempts to bring to Ruby a test double workflow akin to Mockito in Java. Major distinctions include preserving arrange-act-assert in tests, fast feedback for methods the double's real counterpart may not know how to respond to, no string/symbolic representations of methods, argument captors, and strong opinions (weakly held). "
14
14
  s.email = "searls@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -17,9 +17,9 @@ module Gimme
17
17
 
18
18
  #TODO this will be redundantly overwritten
19
19
  meta_class.instance_eval do
20
- define_method method do |*actual_args|
20
+ define_method method do |*actual_args, &actual_block|
21
21
  Gimme.invocations.increment(cls, method, actual_args)
22
- InvokesSatisfiedStubbing.new(cls).invoke(method, actual_args)
22
+ InvokesSatisfiedStubbing.new(cls).invoke(method, actual_args, actual_block)
23
23
  end
24
24
  end
25
25
 
@@ -47,5 +47,19 @@ module Gimme
47
47
  Given(:gives) { give!(subject) }
48
48
  end
49
49
  end
50
+
51
+ context "when called with a block" do
52
+ Given do
53
+ give(Rabbit).eat {|blk| blk.call }
54
+ end
55
+
56
+
57
+ Then do
58
+ obj_in_block = false
59
+ Rabbit.eat { obj_in_block = true }
60
+ obj_in_block.should be_true
61
+ end
62
+ end
63
+
50
64
  end
51
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gimme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-23 00:00:00.000000000 Z
12
+ date: 2014-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
@@ -348,7 +348,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
348
348
  version: '0'
349
349
  segments:
350
350
  - 0
351
- hash: 2170651744190486479
351
+ hash: 673645550442069431
352
352
  required_rubygems_version: !ruby/object:Gem::Requirement
353
353
  none: false
354
354
  requirements: