motion-stump 0.3.0 → 0.3.1

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: dafe29c6f7a0e5c2425dbed30c336b6ab3a354db
4
- data.tar.gz: 6174a4006293ab88a138d6f8d470fdeab9d2a3a9
3
+ metadata.gz: 96b8d6c3804509f8015028fc1880df1608c0763a
4
+ data.tar.gz: 8060b6da5b4ef2d12eda7e7be68f8b73b4f016ff
5
5
  SHA512:
6
- metadata.gz: ba97813ed8f07dc31bf1dd2a5a078bebc60f019ebb2a41c895bd1b7f8173a16dc54901ea6687d3802a7518722eef643d786b8811ba26bd6522a04030cbdb6bc1
7
- data.tar.gz: efd82644bee3d4749b377db7bcbfe32cddec8e998b426966b49f07144ddcf82e06de79719140f1c275e6db36576d059629eb0a37bbf8b145c6943163692a04be
6
+ metadata.gz: 2556b1683b606df4a41ea5536558451f8ecd4851ff52991ec1bacabe193ad86c332896a844ff9cbb568ae7cd71dac5f783a0a0f91d0626fa785cf1c8a2c1b578
7
+ data.tar.gz: 64b141a0bd40354b3353e404a9e0a0936ded767692e1e6a2a5926de71d68d608c5163cb2021e41e4a5eb2c11d9a696dbbf1d4e833ff28cad4264a33680ecce63
data/README.md CHANGED
@@ -22,6 +22,16 @@ your_object.hello do |a, b| # yield with "1" and "2"
22
22
  end
23
23
  ```
24
24
 
25
+ #### Resetting Stubs
26
+
27
+ ```ruby
28
+ Dog.stub!(:kind, return: 'Reptile')
29
+ Dog.reset(:kind)
30
+
31
+ @dog.stub!(:bark, return: 'Meow!')
32
+ @dog.reset(:bark)
33
+ ```
34
+
25
35
  ### Pure stub objects
26
36
  ```ruby
27
37
  my_stub = stub(:thing, :return => "dude, a thing!")
@@ -34,7 +44,7 @@ my_stub.thing # => "dude, a thing!"
34
44
  my_object = "things are fun"
35
45
  my_object.mock!(:fancy, :return => "ooo fancy!")
36
46
  my_object.fancy # => "ooo fancy!"
37
- my_object.mock!(:tancy, :return => "ooo fancy!")
47
+ my_object.mock!(:fancy, :return => "ooo fancy!")
38
48
 
39
49
  # if my_object.tancy is not called, it will fail the spec
40
50
  ```
@@ -23,7 +23,7 @@ class Object
23
23
  Stump::Mocks.verify([self, method])
24
24
  block.call(*args)
25
25
  end
26
- elsif options[:yield]
26
+ elsif !options[:yield].nil?
27
27
  lambda do |*args|
28
28
  Stump::Mocks.verify([self, method])
29
29
  yield(options[:yield])
@@ -1,3 +1,3 @@
1
1
  module Stump
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -109,6 +109,14 @@ describe "Application 'stump-test'" do
109
109
  time.should.be == 10
110
110
  end
111
111
  end
112
+
113
+ it "should be able to yield the boolean value false" do
114
+ @dog.mock!(:get_toy, yield: false)
115
+ @dog.get_toy do |toy|
116
+ toy.should.be == false
117
+ end
118
+ end
119
+
112
120
  end
113
121
 
114
122
  describe "#mock" do
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-stump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Chong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-16 00:00:00.000000000 Z
11
+ date: 2014-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: motion-redgreen
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.1.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Stubbing and mocking for RubyMotion
@@ -45,7 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
48
+ - ".gitignore"
49
49
  - Gemfile
50
50
  - History.txt
51
51
  - License.txt
@@ -72,17 +72,17 @@ require_paths:
72
72
  - lib
73
73
  required_ruby_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.0.0
85
+ rubygems_version: 2.2.0
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Stubbing and mocking for RubyMotion