fake_sns 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 352552063c15566fed3b1ef29de965b1920e8ae2
4
- data.tar.gz: 26f799887b52de66eb0ea5d09e6316b5cf7b931a
3
+ metadata.gz: b861362c289a1a7af6b1dd8ed47872649f7ef1da
4
+ data.tar.gz: 7b6df23053532af553969b5361283bee879a1bd0
5
5
  SHA512:
6
- metadata.gz: 4b4f3eb77ca2d8d16af142f1692fe12b7d0e2fe9b4cc374e0136f6281c62f51407e576b5b5b5052041004ca9da6dbbb5e734baf92fc9230724b21e3233badcef
7
- data.tar.gz: ab7939a921b52848958a9fbf5438dc3d759e62854144cb7dbc5ff157d2638416e4d09b39a750cd5e7d0b170131918ea0ff6d883c547bf64dc376522d87210354
6
+ metadata.gz: 569e6d605977f0ffaf5fb17fc71a4ba1ad4eb36b27ffc3844a916fa075ee500ee0887f4bd9d3f02dbc7d0dde2d5960166cc9d3b2691db28c8e8d37c36fb56673
7
+ data.tar.gz: 9426de77b344c2553a915dcac25230bdd3234dd8670a813b48b6bf59e5952f9a42900cd0bc145289b0f4b0c56249f649a624bff10d3737208fce4483f0523d57
@@ -1,4 +1,5 @@
1
1
  require "faraday"
2
+ require "timeout"
2
3
 
3
4
  module FakeSNS
4
5
  class TestIntegration
@@ -9,6 +10,10 @@ module FakeSNS
9
10
  @options = options
10
11
  end
11
12
 
13
+ def startup_timeout
14
+ options.fetch(:startup_timeout) { 5 }
15
+ end
16
+
12
17
  def host
13
18
  option :sns_endpoint
14
19
  end
@@ -82,12 +87,12 @@ module FakeSNS
82
87
  end
83
88
 
84
89
 
85
- def wait_until_up(deadline = Time.now + 2)
86
- fail "FakeSNS didn't start in time" if Time.now > deadline
87
- unless up?
88
- sleep 0.1
89
- wait_until_up(deadline)
90
+ def wait_until_up
91
+ Timeout.timeout startup_timeout do
92
+ sleep 0.1 until up?
90
93
  end
94
+ rescue Timeout::Error
95
+ fail "FakeSNS didn't start in time (timeout is #{startup_timeout} seconds)"
91
96
  end
92
97
 
93
98
  def binfile
@@ -1,3 +1,3 @@
1
1
  module FakeSNS
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fake_sns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - iain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-15 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra