genghisapp 2.1.0.alpha.1 → 2.1.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
data/spec/spec_helper.rb CHANGED
@@ -1,11 +1,7 @@
1
1
  require 'rspec/autorun'
2
- require 'capybara/rspec'
3
- require 'capybara/poltergeist'
4
2
  require 'json_expressions/rspec'
5
3
  require 'net/http'
6
-
7
- Capybara.default_driver = :poltergeist
8
- Capybara.run_server = false
4
+ require_relative '../genghis.rb'
9
5
 
10
6
  RSpec.configure do |config|
11
7
  def find_available_port
@@ -15,14 +11,24 @@ RSpec.configure do |config|
15
11
  server.close if server
16
12
  end
17
13
 
18
- config.before :all do
14
+ def start_backend(backend)
19
15
  @genghis_port = find_available_port
20
- @genghis_pid = spawn 'php', '-S', "localhost:#{@genghis_port}", 'genghis.php', :out => '/dev/null'
21
- Capybara.app_host = "http://localhost:#{@genghis_port}"
22
- sleep 0.1
16
+
17
+ case backend
18
+ when :php
19
+ @genghis_pid = spawn 'php', '-S', "localhost:#{@genghis_port}", 'genghis.php', :out => '/dev/null'
20
+ sleep 0.1
21
+ Faraday.new url: "http://localhost:#{@genghis_port}"
22
+ when :ruby
23
+ Faraday.new do |conn|
24
+ conn.adapter :rack, Genghis::Server.new
25
+ end
26
+ end
23
27
  end
24
28
 
25
29
  config.after :all do
26
- Process.kill('HUP', @genghis_pid)
30
+ # Kill any outstanding Genghis backend
31
+ Process.kill('HUP', @genghis_pid) unless @genghis_pid.nil?
32
+ @genghis_pid = nil
27
33
  end
28
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genghisapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.alpha.1
4
+ version: 2.1.0.rc.1
5
5
  prerelease: 6
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: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2012-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vegas