fake_braintree 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +10 -0
- data/NEWS.md +5 -0
- data/fake_braintree.gemspec +0 -1
- data/lib/fake_braintree/server.rb +16 -4
- data/lib/fake_braintree/version.rb +1 -1
- data/spec/spec_helper.rb +4 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e8fe207449b5ab83bbc108efb904aad458d4560
|
4
|
+
data.tar.gz: c7a9004feb28faa46ec51f8f0c025211534b60b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b7b3a2eb9e5170ef3ff26058d07ca6bd2b7ea8ef0670b55af185145651192d5ecfe80d7f62244195abc8ae2c8df3708c356280fc8a3c190353efb1a55fdc7d1
|
7
|
+
data.tar.gz: 70c3f140f188764b50aa34c17c4610ca40d9d238a43de53ec5cb1030ebf8c45c0ddc59ce13ce0cedfe6d7d8e583fc49effd067fc81d9d758db09021d4dc98231
|
data/Gemfile
CHANGED
data/NEWS.md
CHANGED
data/fake_braintree.gemspec
CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_dependency 'i18n'
|
23
23
|
s.add_dependency 'sinatra'
|
24
24
|
s.add_dependency 'braintree', '~> 2.5'
|
25
|
-
s.add_dependency 'thin'
|
26
25
|
|
27
26
|
s.add_development_dependency 'rspec', '~> 2.12.0'
|
28
27
|
s.add_development_dependency 'bourne', '~> 1.3'
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'capybara'
|
2
2
|
require 'capybara/server'
|
3
|
-
require 'rack/handler/thin'
|
4
3
|
|
5
4
|
class FakeBraintree::Server
|
5
|
+
|
6
6
|
def boot
|
7
|
-
|
7
|
+
with_runner do
|
8
8
|
server = Capybara::Server.new(FakeBraintree::SinatraApp)
|
9
9
|
server.boot
|
10
10
|
ENV['GATEWAY_PORT'] = server.port.to_s
|
@@ -13,13 +13,25 @@ class FakeBraintree::Server
|
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
-
def
|
16
|
+
def with_runner
|
17
17
|
default_server_process = Capybara.server
|
18
18
|
Capybara.server do |app, port|
|
19
|
-
|
19
|
+
handler.run(app, Port: port)
|
20
20
|
end
|
21
21
|
yield
|
22
22
|
ensure
|
23
23
|
Capybara.server(&default_server_process)
|
24
24
|
end
|
25
|
+
|
26
|
+
def handler
|
27
|
+
if defined?(Thin)
|
28
|
+
require 'rack/handler/thin'
|
29
|
+
Rack::Handler::Thin
|
30
|
+
elsif defined?(Puma)
|
31
|
+
require 'rack/handler/puma'
|
32
|
+
Rack::Handler::Puma
|
33
|
+
else
|
34
|
+
raise 'No Rack handler was defined! Please include `gem "thin"` or `gem "puma"` in your Gemfile."
|
35
|
+
end
|
36
|
+
end
|
25
37
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fake_braintree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot, inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.5'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: thin
|
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
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: rspec
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|