whisperer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +13 -0
  5. data/Gemfile +7 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +293 -0
  8. data/Rakefile +1 -0
  9. data/TODO.md +47 -0
  10. data/lib/whisperer.rb +102 -0
  11. data/lib/whisperer/config.rb +40 -0
  12. data/lib/whisperer/convertors/hash.rb +39 -0
  13. data/lib/whisperer/convertors/interaction.rb +21 -0
  14. data/lib/whisperer/dsl.rb +19 -0
  15. data/lib/whisperer/dsl/base.rb +47 -0
  16. data/lib/whisperer/dsl/body.rb +33 -0
  17. data/lib/whisperer/dsl/headers.rb +20 -0
  18. data/lib/whisperer/dsl/request.rb +15 -0
  19. data/lib/whisperer/dsl/response.rb +15 -0
  20. data/lib/whisperer/dsl/response/status.rb +10 -0
  21. data/lib/whisperer/generator.rb +43 -0
  22. data/lib/whisperer/helpers.rb +16 -0
  23. data/lib/whisperer/placeholder.rb +14 -0
  24. data/lib/whisperer/preprocessors.rb +19 -0
  25. data/lib/whisperer/preprocessors/base.rb +13 -0
  26. data/lib/whisperer/preprocessors/content_length.rb +17 -0
  27. data/lib/whisperer/preprocessors/response_body.rb +23 -0
  28. data/lib/whisperer/record.rb +48 -0
  29. data/lib/whisperer/record/body.rb +15 -0
  30. data/lib/whisperer/record/headers.rb +22 -0
  31. data/lib/whisperer/record/request.rb +16 -0
  32. data/lib/whisperer/record/response.rb +18 -0
  33. data/lib/whisperer/record/response/status.rb +10 -0
  34. data/lib/whisperer/samples/cassette_builder.rb +24 -0
  35. data/lib/whisperer/serializers/base.rb +24 -0
  36. data/lib/whisperer/serializers/json.rb +33 -0
  37. data/lib/whisperer/serializers/json_multiple.rb +14 -0
  38. data/lib/whisperer/tasks/whisperer.rake +88 -0
  39. data/lib/whisperer/version.rb +3 -0
  40. data/spec/cassette_builders/arya_stark.rb +26 -0
  41. data/spec/cassette_builders/bran_stark.rb +19 -0
  42. data/spec/cassette_builders/empty_robb_stark.rb +20 -0
  43. data/spec/cassette_builders/robb_stark.rb +30 -0
  44. data/spec/cassette_builders/robb_stark_without_content_length.rb +20 -0
  45. data/spec/cassette_builders/sansa_stark.rb +9 -0
  46. data/spec/cassette_builders/starks.rb +31 -0
  47. data/spec/cassette_builders/wolfs.rb +7 -0
  48. data/spec/cassettes/empty_robb_stark.yml +22 -0
  49. data/spec/cassettes/girls/arya_stark.yml +24 -0
  50. data/spec/cassettes/robb_stark.yml +28 -0
  51. data/spec/cassettes/robb_stark_without_content_length.yml +22 -0
  52. data/spec/cassettes/sansa_stark.yml +24 -0
  53. data/spec/cassettes/starks.yml +28 -0
  54. data/spec/cassettes/wolfs.yml +28 -0
  55. data/spec/factories/arya_stark.rb +7 -0
  56. data/spec/factories/bran_stark.rb +7 -0
  57. data/spec/factories/ned_stark.rb +7 -0
  58. data/spec/factories/robb_stark.rb +7 -0
  59. data/spec/factories/sansa_stark.rb +7 -0
  60. data/spec/integration/whisperer_spec.rb +51 -0
  61. data/spec/spec_helper.rb +25 -0
  62. data/spec/spec_integration_helper.rb +6 -0
  63. data/spec/support/cassettes.rb +16 -0
  64. data/spec/support/custom_serializer.rb +5 -0
  65. data/spec/unit/config_spec.rb +94 -0
  66. data/spec/unit/convertors/hash_spec.rb +59 -0
  67. data/spec/unit/convertors/interaction_spec.rb +46 -0
  68. data/spec/unit/dsl/base_spec.rb +99 -0
  69. data/spec/unit/dsl/body_spec.rb +73 -0
  70. data/spec/unit/dsl/headers_spec.rb +31 -0
  71. data/spec/unit/dsl/request_spec.rb +4 -0
  72. data/spec/unit/dsl/response_spec.rb +4 -0
  73. data/spec/unit/dsl/status_spec.rb +4 -0
  74. data/spec/unit/dsl_spec.rb +4 -0
  75. data/spec/unit/generator_spec.rb +77 -0
  76. data/spec/unit/helpers_spec.rb +38 -0
  77. data/spec/unit/preprocessors/content_length_spec.rb +39 -0
  78. data/spec/unit/preprocessors/response_body_spec.rb +55 -0
  79. data/spec/unit/preprocessors_spec.rb +8 -0
  80. data/spec/unit/record/headers_spec.rb +21 -0
  81. data/spec/unit/record/response_spec.rb +11 -0
  82. data/spec/unit/record_spec.rb +77 -0
  83. data/spec/unit/serializers/base_spec.rb +19 -0
  84. data/spec/unit/serializers/json_multiple_spec.rb +24 -0
  85. data/spec/unit/serializers/json_spec.rb +37 -0
  86. data/spec/unit/whisperer_spec.rb +189 -0
  87. data/whisperer.gemspec +28 -0
  88. metadata +277 -0
data/whisperer.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'whisperer/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'whisperer'
8
+ spec.version = Whisperer::VERSION
9
+ spec.authors = ['Dmitriy Nesteryuk']
10
+ spec.email = ['nesterukd@gmail.com']
11
+ spec.description = %q{Generate HTTP responses for VCR from structures defined by FactoryGirl}
12
+ spec.summary = %q{Do you hate cassettes? I do as well. The purpose of this library is to make your life much easier when your application works with external API and you have to create a lot of VCR cassettes.}
13
+ spec.homepage = 'http://github.com/dnesteryuk/whisperer'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'factory_girl', '~> 4'
22
+ spec.add_dependency 'vcr', '~> 2'
23
+ spec.add_dependency 'virtus', '~> 1'
24
+ spec.add_dependency 'activesupport'
25
+ spec.add_dependency 'multi_json'
26
+ spec.add_dependency 'rainbow'
27
+ spec.add_dependency 'thread_safe'
28
+ end
metadata ADDED
@@ -0,0 +1,277 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: whisperer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dmitriy Nesteryuk
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: factory_girl
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: vcr
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: virtus
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: activesupport
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: multi_json
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rainbow
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: thread_safe
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Generate HTTP responses for VCR from structures defined by FactoryGirl
112
+ email:
113
+ - nesterukd@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - .gitignore
119
+ - .rspec
120
+ - .travis.yml
121
+ - Gemfile
122
+ - LICENSE.txt
123
+ - README.md
124
+ - Rakefile
125
+ - TODO.md
126
+ - lib/whisperer.rb
127
+ - lib/whisperer/config.rb
128
+ - lib/whisperer/convertors/hash.rb
129
+ - lib/whisperer/convertors/interaction.rb
130
+ - lib/whisperer/dsl.rb
131
+ - lib/whisperer/dsl/base.rb
132
+ - lib/whisperer/dsl/body.rb
133
+ - lib/whisperer/dsl/headers.rb
134
+ - lib/whisperer/dsl/request.rb
135
+ - lib/whisperer/dsl/response.rb
136
+ - lib/whisperer/dsl/response/status.rb
137
+ - lib/whisperer/generator.rb
138
+ - lib/whisperer/helpers.rb
139
+ - lib/whisperer/placeholder.rb
140
+ - lib/whisperer/preprocessors.rb
141
+ - lib/whisperer/preprocessors/base.rb
142
+ - lib/whisperer/preprocessors/content_length.rb
143
+ - lib/whisperer/preprocessors/response_body.rb
144
+ - lib/whisperer/record.rb
145
+ - lib/whisperer/record/body.rb
146
+ - lib/whisperer/record/headers.rb
147
+ - lib/whisperer/record/request.rb
148
+ - lib/whisperer/record/response.rb
149
+ - lib/whisperer/record/response/status.rb
150
+ - lib/whisperer/samples/cassette_builder.rb
151
+ - lib/whisperer/serializers/base.rb
152
+ - lib/whisperer/serializers/json.rb
153
+ - lib/whisperer/serializers/json_multiple.rb
154
+ - lib/whisperer/tasks/whisperer.rake
155
+ - lib/whisperer/version.rb
156
+ - spec/cassette_builders/arya_stark.rb
157
+ - spec/cassette_builders/bran_stark.rb
158
+ - spec/cassette_builders/empty_robb_stark.rb
159
+ - spec/cassette_builders/robb_stark.rb
160
+ - spec/cassette_builders/robb_stark_without_content_length.rb
161
+ - spec/cassette_builders/sansa_stark.rb
162
+ - spec/cassette_builders/starks.rb
163
+ - spec/cassette_builders/wolfs.rb
164
+ - spec/cassettes/empty_robb_stark.yml
165
+ - spec/cassettes/girls/arya_stark.yml
166
+ - spec/cassettes/robb_stark.yml
167
+ - spec/cassettes/robb_stark_without_content_length.yml
168
+ - spec/cassettes/sansa_stark.yml
169
+ - spec/cassettes/starks.yml
170
+ - spec/cassettes/wolfs.yml
171
+ - spec/factories/arya_stark.rb
172
+ - spec/factories/bran_stark.rb
173
+ - spec/factories/ned_stark.rb
174
+ - spec/factories/robb_stark.rb
175
+ - spec/factories/sansa_stark.rb
176
+ - spec/integration/whisperer_spec.rb
177
+ - spec/spec_helper.rb
178
+ - spec/spec_integration_helper.rb
179
+ - spec/support/cassettes.rb
180
+ - spec/support/custom_serializer.rb
181
+ - spec/unit/config_spec.rb
182
+ - spec/unit/convertors/hash_spec.rb
183
+ - spec/unit/convertors/interaction_spec.rb
184
+ - spec/unit/dsl/base_spec.rb
185
+ - spec/unit/dsl/body_spec.rb
186
+ - spec/unit/dsl/headers_spec.rb
187
+ - spec/unit/dsl/request_spec.rb
188
+ - spec/unit/dsl/response_spec.rb
189
+ - spec/unit/dsl/status_spec.rb
190
+ - spec/unit/dsl_spec.rb
191
+ - spec/unit/generator_spec.rb
192
+ - spec/unit/helpers_spec.rb
193
+ - spec/unit/preprocessors/content_length_spec.rb
194
+ - spec/unit/preprocessors/response_body_spec.rb
195
+ - spec/unit/preprocessors_spec.rb
196
+ - spec/unit/record/headers_spec.rb
197
+ - spec/unit/record/response_spec.rb
198
+ - spec/unit/record_spec.rb
199
+ - spec/unit/serializers/base_spec.rb
200
+ - spec/unit/serializers/json_multiple_spec.rb
201
+ - spec/unit/serializers/json_spec.rb
202
+ - spec/unit/whisperer_spec.rb
203
+ - whisperer.gemspec
204
+ homepage: http://github.com/dnesteryuk/whisperer
205
+ licenses:
206
+ - MIT
207
+ metadata: {}
208
+ post_install_message:
209
+ rdoc_options: []
210
+ require_paths:
211
+ - lib
212
+ required_ruby_version: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ! '>='
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
217
+ required_rubygems_version: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ requirements: []
223
+ rubyforge_project:
224
+ rubygems_version: 2.2.2
225
+ signing_key:
226
+ specification_version: 4
227
+ summary: Do you hate cassettes? I do as well. The purpose of this library is to make
228
+ your life much easier when your application works with external API and you have
229
+ to create a lot of VCR cassettes.
230
+ test_files:
231
+ - spec/cassette_builders/arya_stark.rb
232
+ - spec/cassette_builders/bran_stark.rb
233
+ - spec/cassette_builders/empty_robb_stark.rb
234
+ - spec/cassette_builders/robb_stark.rb
235
+ - spec/cassette_builders/robb_stark_without_content_length.rb
236
+ - spec/cassette_builders/sansa_stark.rb
237
+ - spec/cassette_builders/starks.rb
238
+ - spec/cassette_builders/wolfs.rb
239
+ - spec/cassettes/empty_robb_stark.yml
240
+ - spec/cassettes/girls/arya_stark.yml
241
+ - spec/cassettes/robb_stark.yml
242
+ - spec/cassettes/robb_stark_without_content_length.yml
243
+ - spec/cassettes/sansa_stark.yml
244
+ - spec/cassettes/starks.yml
245
+ - spec/cassettes/wolfs.yml
246
+ - spec/factories/arya_stark.rb
247
+ - spec/factories/bran_stark.rb
248
+ - spec/factories/ned_stark.rb
249
+ - spec/factories/robb_stark.rb
250
+ - spec/factories/sansa_stark.rb
251
+ - spec/integration/whisperer_spec.rb
252
+ - spec/spec_helper.rb
253
+ - spec/spec_integration_helper.rb
254
+ - spec/support/cassettes.rb
255
+ - spec/support/custom_serializer.rb
256
+ - spec/unit/config_spec.rb
257
+ - spec/unit/convertors/hash_spec.rb
258
+ - spec/unit/convertors/interaction_spec.rb
259
+ - spec/unit/dsl/base_spec.rb
260
+ - spec/unit/dsl/body_spec.rb
261
+ - spec/unit/dsl/headers_spec.rb
262
+ - spec/unit/dsl/request_spec.rb
263
+ - spec/unit/dsl/response_spec.rb
264
+ - spec/unit/dsl/status_spec.rb
265
+ - spec/unit/dsl_spec.rb
266
+ - spec/unit/generator_spec.rb
267
+ - spec/unit/helpers_spec.rb
268
+ - spec/unit/preprocessors/content_length_spec.rb
269
+ - spec/unit/preprocessors/response_body_spec.rb
270
+ - spec/unit/preprocessors_spec.rb
271
+ - spec/unit/record/headers_spec.rb
272
+ - spec/unit/record/response_spec.rb
273
+ - spec/unit/record_spec.rb
274
+ - spec/unit/serializers/base_spec.rb
275
+ - spec/unit/serializers/json_multiple_spec.rb
276
+ - spec/unit/serializers/json_spec.rb
277
+ - spec/unit/whisperer_spec.rb