tshield 0.11.6.0 → 0.11.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c640cd371996f18c70873cdb29f9ebddd56feec72a2a28f97ab12e8c2dea7c79
4
- data.tar.gz: db3eafdb27d4b6c6aa7b5f3ccd8480f045f8629beaf61ac431e6d038d8bf3dd2
3
+ metadata.gz: cd161c62a3f2ed18d05c36ba7bacfff84a96f92fa7460d9702611af7ac60f33a
4
+ data.tar.gz: 046ff96f18c8504bce45c7cac21457b75fe46c6f836031279ec481e1e6a4a44c
5
5
  SHA512:
6
- metadata.gz: '08a7fa0ab19a76dfbd9f1c262836c5c6e67b2c5ea85db39271162ccce204291e08a27962327f2e95c5921f696c3cfb6cdc541d69eaa8f441af994d63c7246053'
7
- data.tar.gz: b8c45e92156a2f1fcbd2016338eaa9aa424edecff1b6248bb11c0cabc747f58ff82012d6fd048dc548825b6b46c208b8ed0bbb2b96a27036c6ce9bdf4accf413
6
+ metadata.gz: ce930e5ee1b0a6964c1e6a4255236fb4925fbc87779729aefdc594016a2d71d69afd2ad5b7ada1083314fb2eab8aefb9ce121181f44b2b2a0e957edf10a277bb
7
+ data.tar.gz: 585dc9bf34107431b2d93cfc46fe92ef2584f4614d0de9c82a41659f855e374a88cc441b4eedfabffa79aa1b4f17151594f98f4ef0daaa3f095a7ce688eef7de
@@ -35,7 +35,10 @@ module TShield
35
35
  end
36
36
 
37
37
  def current_response
38
- return matched[@options[:call]] if matched.is_a? Array
38
+ if matched.is_a? Array
39
+ index = @options[:call] % matched.size
40
+ return matched[index]
41
+ end
39
42
 
40
43
  matched
41
44
  end
@@ -5,7 +5,7 @@ module TShield
5
5
  class Version
6
6
  MAJOR = 0
7
7
  MINOR = 11
8
- PATCH = 6
8
+ PATCH = 7
9
9
  PRE = 0
10
10
 
11
11
  class << self
@@ -131,7 +131,7 @@ describe TShield::RequestMatching do
131
131
  context 'on match have multiples responses' do
132
132
  before :each do
133
133
  @responses = []
134
- 2.times.each do |time|
134
+ 3.times.each do |time|
135
135
  @responses << TShield::RequestMatching
136
136
  .new('/matching/twice',
137
137
  method: 'GET',
@@ -152,6 +152,13 @@ describe TShield::RequestMatching do
152
152
  expect(response.headers).to eql('try' => 2)
153
153
  expect(response.status).to eql(201)
154
154
  end
155
+
156
+ it 'should return first response object in third call' do
157
+ response = @responses[2]
158
+ expect(response.body).to eql('first call')
159
+ expect(response.headers).to eql('try' => 1)
160
+ expect(response.status).to eql(200)
161
+ end
155
162
  end
156
163
  context 'on not match' do
157
164
  before :each do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tshield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.6.0
4
+ version: 0.11.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Rubin