response_mate 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- response_mate (0.3.0)
4
+ response_mate (0.3.1)
5
5
  activesupport
6
6
  addressable
7
7
  awesome_print
@@ -10,7 +10,9 @@ class ResponseMate::Request < OpenStruct
10
10
  request[:verb] = 'GET'
11
11
  end
12
12
 
13
- request[:url] = URI.encode(adjust_scheme(request[:url], request[:scheme]))
13
+ if request[:url] !~ /{{.*?}}/ # Avoid encoding unprocessed mustache tags
14
+ request[:url] = URI.encode(adjust_scheme(request[:url], request[:scheme]))
15
+ end
14
16
 
15
17
  self
16
18
  end
@@ -1,4 +1,4 @@
1
1
  module ResponseMate
2
2
  # Gem version
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
@@ -3,13 +3,8 @@ require 'spec_helper'
3
3
  describe ResponseMate::Exporters::Postman::Collection do
4
4
  include_context 'stubbed_requests'
5
5
 
6
- let(:environment) do
7
- ResponseMate::Environment.new(ResponseMate.configuration.environment)
8
- end
9
-
10
6
  let(:manifest) do
11
- ResponseMate::Manifest.new(ResponseMate.configuration.requests_manifest,
12
- environment)
7
+ ResponseMate::Manifest.new(ResponseMate.configuration.requests_manifest)
13
8
  end
14
9
 
15
10
  describe '#export' do
@@ -111,5 +106,20 @@ describe ResponseMate::Exporters::Postman::Collection do
111
106
  it { expect(subject[:headers]).to be_a(String) }
112
107
  end
113
108
  end
109
+
110
+ context 'when the manifest contains mustache tags' do
111
+ before do
112
+ ResponseMate.stub_chain(:configuration, :requests_manifest).
113
+ and_return File.expand_path('spec/source/requests_mustache.yml')
114
+ end
115
+
116
+ describe 'requests' do
117
+ subject { exported[:requests].last }
118
+
119
+ it 'have mustache unprocessed' do
120
+ expect(subject[:url]).to match(/{{.*?}}/)
121
+ end
122
+ end
123
+ end
114
124
  end
115
125
  end
@@ -0,0 +1,38 @@
1
+ default_headers: &default_headers
2
+ accept: 'application/vnd.someapi+json; version=3'
3
+ authorization: 'Bearer {{oauth_token}}'
4
+
5
+ description: |
6
+ A thorought description about the requests of this manifest.
7
+
8
+ requests:
9
+ -
10
+ key: user_issues
11
+ meta:
12
+ description: The issues of the user
13
+ request:
14
+ url: 'www.someapi.com/user/42/issues'
15
+ headers:
16
+ <<: *default_headers
17
+
18
+ - key: user_friends
19
+ meta:
20
+ description: The friends of the user
21
+ request:
22
+ url: 'www.someapi.com/user/42/friends'
23
+ headers:
24
+ <<: *default_headers
25
+ params:
26
+ trusty: 'yes'
27
+ since: 'childhood'
28
+
29
+ - key: user_friends_with_mustache
30
+ meta:
31
+ description: The manlier friends of the user
32
+ request:
33
+ url: '{{base_url}}/user/42/friends'
34
+ headers:
35
+ <<: *default_headers
36
+ params:
37
+ trusty: 'yes'
38
+ since: 'adulthood'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: response_mate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-12 00:00:00.000000000 Z
12
+ date: 2014-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -263,6 +263,7 @@ files:
263
263
  - spec/source/environment.yml
264
264
  - spec/source/other_output_dir/.gitkeep
265
265
  - spec/source/requests.yml
266
+ - spec/source/requests_mustache.yml
266
267
  - spec/source/responses/.gitkeep
267
268
  - spec/spec_helper.rb
268
269
  - spec/support/stubbed_requests.rb
@@ -305,6 +306,7 @@ test_files:
305
306
  - spec/source/environment.yml
306
307
  - spec/source/other_output_dir/.gitkeep
307
308
  - spec/source/requests.yml
309
+ - spec/source/requests_mustache.yml
308
310
  - spec/source/responses/.gitkeep
309
311
  - spec/spec_helper.rb
310
312
  - spec/support/stubbed_requests.rb