rspec-intercept 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -3
- data/lib/rspec/intercept.rb +1 -0
- data/lib/rspec/intercept/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a67ee26088808011578c31cdc17c53336fcc965d
|
|
4
|
+
data.tar.gz: 5d277563ee09b0d7d2d5189109a95a0990f86980
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ebf58ce16392bb868dc854ce907f89f67b12e4f62f4b2bfb43d286d0447ed0d9f404e96b9334bd22e57680e4d710571858bb3964c4556b76ccc78e1391730a48
|
|
7
|
+
data.tar.gz: 1ad3d1cfdf6d0c87bce9d66561e8355c14b7fac08d438ce7b3c872e3e2a3dd0b71be7866baf8138edfe8a331b5149388cdb58f259f9e518f62c29adf2477ddea
|
data/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# RSpec::Intercept
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lets you intercept method calls in RSpec tests and tinker with
|
|
4
|
+
the arguments for or the return value of the original method.
|
|
4
5
|
|
|
5
6
|
## Installation
|
|
6
7
|
|
|
@@ -20,11 +21,19 @@ Or install it yourself as:
|
|
|
20
21
|
|
|
21
22
|
## Usage
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
```rb
|
|
25
|
+
intercept(Foo, :bar) do |method, *args, &block|
|
|
26
|
+
method.call(*args, &block)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
intercept_any_instance_of(Foo, :bar) do |method, *args, &block|
|
|
30
|
+
method.call(*args, &block)
|
|
31
|
+
end
|
|
32
|
+
```
|
|
24
33
|
|
|
25
34
|
## Contributing
|
|
26
35
|
|
|
27
|
-
1. Fork it ( https://github.com/
|
|
36
|
+
1. Fork it ( https://github.com/ad2games/rspec-intercept/fork )
|
|
28
37
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
29
38
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
30
39
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/rspec/intercept.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-intercept
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Helge Rausch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-09-
|
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec-mocks
|