stubsvc 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/README.md +10 -10
- data/lib/stubsvc/version.rb +1 -1
- data/stubsvc.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e093289ff5402c4c385172a8d2c513bbae070ebc
|
4
|
+
data.tar.gz: fc66782fab170c7e599cffe63a62289f0dd2886c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49923503b12820460bea10fc96ffa6e17aa9fda4768262eaed548950e194fa5980008c3e8fc882b39d4107680b67d3a3c892c507326d4fda697620850cead2ee
|
7
|
+
data.tar.gz: be961aae1a3fa06e517fa10bdafeb652421928d9e49f343a8ecb895a6bb403922446b8d8aef05b17a73ac9eb8ee4e38d8bab4649c5a9f3665e74067c148f3099
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Stubsvc
|
2
2
|
|
3
|
-
**Version: 0.1.
|
3
|
+
**Version: 0.1.4**
|
4
4
|
|
5
|
-
|
5
|
+
Stub calls to ActiveResource based web services using [Webmock](https://github.com/bblimke/webmock).
|
6
6
|
|
7
|
-
|
7
|
+
Testing [SOA](http://www.service-architecture.com/articles/web-services/service-oriented_architecture_soa_definition.html) - [ActiveResource](https://github.com/rails/activeresource) services can be problematic using [VCR](https://github.com/vcr/vcr). `Stubsvc` makes it to stub these kinds of RESTful calls to external services, in a deterministic way.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -47,9 +47,9 @@ There are two ways to stub a service call:
|
|
47
47
|
1. `Stubsvc.stub_action`
|
48
48
|
2. `Stubsvc.stub_verb`
|
49
49
|
|
50
|
-
####
|
50
|
+
#### stub_action
|
51
51
|
|
52
|
-
`Stubsvc.stub_action` is for Rails [ActiveResource](https://github.com/rails/activeresource) type actions
|
52
|
+
`Stubsvc.stub_action` is for Rails [ActiveResource](https://github.com/rails/activeresource) type actions and accepts the following arguments:
|
53
53
|
|
54
54
|
Stubsvc.stub_action(service, action, resource, return_hash, status)
|
55
55
|
|
@@ -59,9 +59,9 @@ There are two ways to stub a service call:
|
|
59
59
|
* return_hash - (optional) A hash representation of the JSON data you want returned for this call. If you don't care what gets returned and leave this argument out, it will default to `"{}"`
|
60
60
|
* status - (optional) The HTTP status code that should be returned. Defaults to 200
|
61
61
|
|
62
|
-
####
|
62
|
+
#### stub_verb
|
63
63
|
|
64
|
-
`Stubsvc.stub_verb` is for stubbing standard HTTP verbs
|
64
|
+
`Stubsvc.stub_verb` is for stubbing standard, RESTful HTTP verbs and accepts the following arguments:
|
65
65
|
|
66
66
|
Stubsvc.stub_verb(service, http_verb, uri, return_hash, status)
|
67
67
|
|
@@ -78,12 +78,12 @@ Let's say I have a model called `Article`. Whenever an `Article` instance is cre
|
|
78
78
|
We want to unit test the `create` method for `ArticlesController`, without having to fire up the external service. We can stub out the call to the file service `Folder.create` method like this:
|
79
79
|
|
80
80
|
RSpec.describe ArticlesController, type: :controller do
|
81
|
-
let(:valid_params) do
|
81
|
+
let(:valid_params) do
|
82
82
|
{
|
83
83
|
article: {
|
84
84
|
name: 'Test Article'
|
85
85
|
}
|
86
|
-
}
|
86
|
+
}
|
87
87
|
end
|
88
88
|
|
89
89
|
it 'persists an Article instance' do
|
@@ -108,7 +108,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
108
108
|
|
109
109
|
## Contributing
|
110
110
|
|
111
|
-
1. Fork it
|
111
|
+
1. Fork it
|
112
112
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
113
113
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
114
114
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/stubsvc/version.rb
CHANGED
data/stubsvc.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.description = <<-stop
|
14
14
|
A Ruby gem that makes it easy to stub out calls to external web services using Webmock.
|
15
15
|
stop
|
16
|
-
spec.homepage = ''
|
16
|
+
spec.homepage = 'https://bitbucket.org/midwiretech/stubsvc/overview'
|
17
17
|
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
19
|
spec.bindir = 'exe'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stubsvc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Blackburn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -200,7 +200,7 @@ files:
|
|
200
200
|
- lib/stubsvc/stubber.rb
|
201
201
|
- lib/stubsvc/version.rb
|
202
202
|
- stubsvc.gemspec
|
203
|
-
homepage:
|
203
|
+
homepage: https://bitbucket.org/midwiretech/stubsvc/overview
|
204
204
|
licenses: []
|
205
205
|
metadata: {}
|
206
206
|
post_install_message:
|
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
221
|
rubyforge_project:
|
222
|
-
rubygems_version: 2.4.5
|
222
|
+
rubygems_version: 2.4.5.1
|
223
223
|
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: Stub out calls to external web services.
|