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 +4 -4
- data/README.md +11 -1
- data/lib/stump/mock.rb +1 -1
- data/lib/stump/version.rb +1 -1
- data/spec/main_spec.rb +8 -0
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96b8d6c3804509f8015028fc1880df1608c0763a
|
4
|
+
data.tar.gz: 8060b6da5b4ef2d12eda7e7be68f8b73b4f016ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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!(:
|
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
|
```
|
data/lib/stump/mock.rb
CHANGED
data/lib/stump/version.rb
CHANGED
data/spec/main_spec.rb
CHANGED
@@ -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.
|
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:
|
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.
|
85
|
+
rubygems_version: 2.2.0
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Stubbing and mocking for RubyMotion
|