acfs 0.26.0.1.b243 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZWY5MGE0YjI4MTliMTNiZmIxYzI3YzhkMjg3NzJhMjM5MjZmNGFhNg==
5
- data.tar.gz: !binary |-
6
- NDI2YjRhYjA4M2U4NTZkOWFhOWMyYmY5NmMwZGM3Y2YxYzgyYjMzZA==
2
+ SHA1:
3
+ metadata.gz: 09061e27036105e3c7a31a725a69c71d4bf962b6
4
+ data.tar.gz: a73c5f06384d40d6af0e0665f4f340664509910c
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- M2YzMTBlODIwNGE0ZmMzYjFlOTRlMDRmM2U3YzdlMzVjMTkwNDFmY2FiNGQ3
10
- YmUwZGZmMzg0MTRkYjRiOWYzNjRiZGM3OWJlMjEzYzg3ZDA2Njk2NjExNDZi
11
- MjY3ODBlMTM3M2ZiOWQ1OGZiM2VjZjVkYzVhZTIxMGQxMTk4ODg=
12
- data.tar.gz: !binary |-
13
- Yzc5ODllM2NlZmYxMWE1ZGEzNWUzZjE2YzM2MzhhNDg2ZmRlNTRhN2EyNjY3
14
- ZmEzYzA4NmM4NTNkZjUyOTJlYTEwMzVhZmNkNjE5MjAyNmViNmY5ZDJhN2U0
15
- ZDk3YzI2M2JkMTY1YTc3NmYwYTY1Y2E5ZTFlMTg4NTdlMGE2Yjc=
6
+ metadata.gz: e6c266e8587a2aa655f1e23bf448b99a332761d3c283e7d878eb6709e7b2c03a1a6748f3aece2642e88765de7ddad7564be84678f6381fff0b5a2f8db2dcddba
7
+ data.tar.gz: bcdabb646d48607885bcf6fa23549c4f2e10246e7a7d025063e477eaf43b2cc2df8fd21c0f04e4ec8d10831b4f204bb44c2306a51ae80cd43c79587bda305b0d
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.27.0
4
+
5
+ * Reset method to clear stubs, request queues, internal state
6
+ * Add RSpec helper to enable stubs and clear state after each spec
7
+
3
8
  ## 0.26.0
4
9
 
5
10
  * Add support for singleton resources (Nicolas Fricke)
data/README.md CHANGED
@@ -147,10 +147,10 @@ class Single < Acfs::SingletonResource
147
147
  service UserService # Associate `Single` model with `UserService`.
148
148
 
149
149
  # Define model attributes and types as with regular resources
150
-
150
+
151
151
  attribute :name, :string, default: 'Anonymous'
152
152
  attribute :age, :integer
153
-
153
+
154
154
  end
155
155
  ```
156
156
 
@@ -217,9 +217,14 @@ Acfs.run
217
217
  You can stub resources in applications using an Acfs service client:
218
218
 
219
219
  ```ruby
220
- # Enable stubs in spec helper
221
- Acfs::Stub.enable
220
+ # spec_helper.rb
222
221
 
222
+ # This will enable stabs before each spec and clear internal state
223
+ # after each spec.
224
+ require 'acfs/rspec'
225
+ ```
226
+
227
+ ```ruby
223
228
  before do
224
229
  @stub = Acfs::Stub.resource MyUser, :read, with: { id: 1 }, return: { id: 1, name: 'John Smith', age: 32 }
225
230
  Acfs::Stub.resource MyUser, :read, with: { id: 2 }, raise: :not_found
@@ -31,5 +31,14 @@ module Acfs
31
31
  def configure(&block)
32
32
  Configuration.current.configure &block
33
33
  end
34
+
35
+ # @api public
36
+ #
37
+ # Reset all queues, stubs and internal state.
38
+ #
39
+ def reset
40
+ self.runner.clear
41
+ Acfs::Stub.clear
42
+ end
34
43
  end
35
44
  end
@@ -0,0 +1,11 @@
1
+ require 'acfs'
2
+
3
+ RSpec.configure do |config|
4
+ config.before(:each) do
5
+ Acfs::Stub.enable
6
+ end
7
+
8
+ config.after(:each) do
9
+ Acfs.reset
10
+ end
11
+ end
@@ -1,7 +1,7 @@
1
1
  module Acfs
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 26
4
+ MINOR = 27
5
5
  PATCH = 0
6
6
  STAGE = nil
7
7
 
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0.1.b243
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-06 00:00:00.000000000 Z
11
+ date: 2014-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.1'
20
20
  type: :runtime
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: '3.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.1'
34
34
  type: :runtime
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: '3.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: actionpack
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: multi_json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: typhoeus
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.6.5
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.6.5
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rack
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.3'
111
111
  description: API Client For Services
@@ -115,9 +115,9 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - .gitignore
119
- - .rspec
120
- - .travis.yml
118
+ - ".gitignore"
119
+ - ".rspec"
120
+ - ".travis.yml"
121
121
  - CHANGELOG.md
122
122
  - Gemfile
123
123
  - Guardfile
@@ -169,6 +169,7 @@ files:
169
169
  - lib/acfs/response.rb
170
170
  - lib/acfs/response/formats.rb
171
171
  - lib/acfs/response/status.rb
172
+ - lib/acfs/rspec.rb
172
173
  - lib/acfs/runner.rb
173
174
  - lib/acfs/service.rb
174
175
  - lib/acfs/service/middleware.rb
@@ -214,17 +215,17 @@ require_paths:
214
215
  - lib
215
216
  required_ruby_version: !ruby/object:Gem::Requirement
216
217
  requirements:
217
- - - ! '>='
218
+ - - ">="
218
219
  - !ruby/object:Gem::Version
219
220
  version: '0'
220
221
  required_rubygems_version: !ruby/object:Gem::Requirement
221
222
  requirements:
222
- - - ! '>'
223
+ - - ">="
223
224
  - !ruby/object:Gem::Version
224
- version: 1.3.1
225
+ version: '0'
225
226
  requirements: []
226
227
  rubyforge_project:
227
- rubygems_version: 2.2.0
228
+ rubygems_version: 2.2.1
228
229
  signing_key:
229
230
  specification_version: 4
230
231
  summary: An abstract API base client for service oriented application.
@@ -256,3 +257,4 @@ test_files:
256
257
  - spec/spec_helper.rb
257
258
  - spec/support/response.rb
258
259
  - spec/support/service.rb
260
+ has_rdoc: